Better HN
topnewbestaskshowjobs
Log inSign up

lukashed

3,324 karma · joined Jan 19, 2013 (13y ago) · 347 submissions

cofounder @datacake

[ my public key: https://keybase.io/lukasklein; my proof: https://keybase.io/lukasklein/sigs/nLll71viAC8aFKoFIesVGVNtoXNhcJN1uebaPbxzCuo ]

Submissions

151.

Analyze your website speed and performance(sitespeed.io ↗)

3 points · by lukashed · 12y ago · discuss

152.

IOS in-app bug reporting with annotated screenshots and the console log(github.com ↗)

1 points · by lukashed · 12y ago · discuss

153.

Why You Should Not Use MyCryptoChat(dustri.org ↗)

2 points · by lukashed · 12y ago · discuss

154.

Turkey passes controversial medical aid bill(aljazeera.com ↗)

3 points · by lukashed · 12y ago · discuss

155.

Smog in Beijing Is So Awful You Have to Catch the Sunrise on a Big Screen(world.time.com ↗)

2 points · by lukashed · 12y ago · discuss

156.

Lessons for non-immigrant workers in the US(pedro.herokuapp.com ↗)

1 points · by lukashed · 12y ago · discuss

157.

When did we start trusting bad code?(blog.erratasec.com ↗)

4 points · by lukashed · 12y ago · discuss

158.

China's Titanic replica will simulate maritime tragedy for entertainment(theverge.com ↗)

1 points · by lukashed · 12y ago · discuss

159.

Facebook Sponsored Stories will be removed from the site on April 9th(theverge.com ↗)

2 points · by lukashed · 12y ago · discuss

160.

Apple dials back ‘flat’ obsession in iOS 7.1(usblog.isobar.com ↗)

4 points · by lukashed · 12y ago · 1 comment

comment 12y ago · link · parent

Here's another magical version that uses a class decorator:

  class Autoinit(object):
      def __call__(self, cls):
          orig_init = cls.__init__
          arg_count = orig_init.func_code.co_argcount
          arg_vars = orig_init.func_code.co_varnames[1:1 + arg_count]
  
          class Wrapped(cls):
              def __init__(self, *args, **kwargs):
                  for pos, var in enumerate(arg_vars[:len(args)]):
                      setattr(self, var, args[pos])
                  for var in kwargs:
                      setattr(self, var, kwargs[var])
                  return orig_init(self, *args, **kwargs)
  
          return Wrapped

  
  if __name__ == '__main__':
      @Autoinit()
      class Test(object):
          def __init__(self, a, b):
              pass
  
      t = Test(1, b=2)
      print t.a, t.b

[Disclaimer: This is my first class decorator. Please correct me if I'm wrong.]

162.

Raspberry Pi Cookbook Videos(razzpisampler.oreilly.com ↗)

1 points · by lukashed · 12y ago · discuss

163.

Improve Your Python: Metaclasses and Dynamic Classes With Type(jeffknupp.com ↗)

115 points · by lukashed · 12y ago · 13 comments

164.

A Web UI for Docker(github.com ↗)

2 points · by lukashed · 12y ago · discuss

165.

Exploitable PHP Functions (2010)(stackoverflow.com ↗)

1 points · by lukashed · 12y ago · discuss

166.

ES6 Module Transpiler(github.com ↗)

1 points · by lukashed · 12y ago · discuss

167.

Putin: I envy Obama, because he can spy and get away with it [video](youtube.com ↗)

5 points · by lukashed · 12y ago · discuss

168.

Easy Secure WiFi(angel.co ↗)

1 points · by lukashed · 12y ago · discuss

169.

How the first PHP functions were named(phpmanualmasterpieces.tumblr.com ↗)

55 points · by lukashed · 12y ago · 66 comments

170.

In Search of Erupting Black Holes(radio.galaxyzoo.org ↗)

2 points · by lukashed · 12y ago · discuss

171.

Korea Will Soon Be Home To The World's First 'Invisible' Skyscraper(businessinsider.com ↗)

2 points · by lukashed · 12y ago · discuss

172.

Slam Shell(slamshell.com ↗)

1 points · by lukashed · 12y ago · discuss

173.

Using a Hosts File To Make The Internet Not Suck (as much)(someonewhocares.org ↗)

1 points · by lukashed · 12y ago · discuss

174.

Man doing sign language at Mandela memorial was a fake(irishtimes.com ↗)

4 points · by lukashed · 12y ago · 2 comments

175.

Adding Django stacktraces to log messages(blog.ionelmc.ro ↗)

2 points · by lukashed · 12y ago · discuss

176.

Bad Python Jokes For The Holidays(audreyr.com ↗)

2 points · by lukashed · 13y ago · discuss

177.

The copyright industry should brace itself: the Kim Dotcom saga isn't over(theguardian.com ↗)

91 points · by lukashed · 13y ago · 118 comments

1
567
12