This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /var/www/nginx; | |
index index.html; | |
server_name ender.noradltd.com; | |
rewrite ^/e/(\d+)$ /f?id=$1 last; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [ { :items => [{ 'item' => 'junk' },{ 'item' => 'junk' },{ 'item' => 'junk' }] }] | |
# => [{:items=>[{"item"=>"junk"}, {"item"=>"junk"}, {"item"=>"junk"}]}] | |
a[0][:items].count # => 3 | |
d = [] # => [] | |
d.push a[0][:items] # => [[{"item"=>"junk"}, {"item"=>"junk"}, {"item"=>"junk"}]] | |
d.count # => 1, not 3 | |
d.push a[0][:items] # => [[{"item"=>"junk"}, {"item"=>"junk"}, {"item"=>"junk"}], [{"item"=>"junk"}, {"item"=>"junk"}, {"item"=>"junk"}]] | |
d.count # => 2, not 6 | |
d.flatten.count # => 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Do You Wanna Test Me" | |
We've been here too long tryin' to get green | |
Pretendin' that you're oh, so dry | |
I'm a natural ma'am doin' all I can | |
My coverage is runnin' high | |
Cry at night no one in sight | |
An' we got so much to share | |
Talking's fine if you got the time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for agency_files in list(r): | |
for key in agency_files: | |
values = agency_files[key] | |
if isinstance(values,list): | |
print("processing list %s" % values) | |
for value in values: | |
file_map[key].append(value) | |
else: | |
file_map[key].append(agency_files[key]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [42]: class Foo(object): | |
....: def bar(self): | |
....: return 'x' | |
....: | |
In [43]: class Baz(object): | |
....: def biz(self): | |
....: return Foo().bar() | |
....: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/association/bin/python3 -m cProfile -o profile.out ~/association/bin/associatedata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install qcachegrind # install qcachegrind, you only need to do this once | |
scp azureuser@cgoa-dev.cloudapp.net:data/profile.out . # copy the profile.out file from the server | |
pip install pyprof2calltree # install the profile converter, you only need to do this once | |
pyprof2calltree -i profile.out # convert the profile to a file qcachegrind can read | |
qcachegrind profile.out.log # start qcachegrind to see the profile information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You'll take my life but I'll take yours too | |
You'll fire your Dev-Ops but I'll Hack you through | |
So when you're waiting for the Azure Stack | |
You'd better stand there's no turning back | |
The bugle sounds as the Upload begins | |
But on this Cloud no one wins | |
The smell of acrid smoke and Coffee breath | |
As you plunge into a certain death |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let(:factory) { gimme(ServiceLoaderFactory) } | |
let(:uri) { 'endpoint' } | |
# ... | |
it 'handles both failure and success appropriately' do | |
@idx = 0 | |
give(factory).create { | |
@idx += 1 | |
[ Proc.new { fail 'massively' }, Proc.new { } ][@idx-1].call | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo(object): | |
@classmethod | |
def bar(cls,x): | |
cls.x = x | |
def p(self): | |
print self.x | |
a = Foo() | |
a.bar(1) | |
a.p() # 1 |