Skip to content

Instantly share code, notes, and snippets.

View pkoch's full-sized avatar

Paulo Koch pkoch

View GitHub Profile
@pkoch
pkoch / array.py
Created March 4, 2015 00:33
Buffer vs. Array join
import resource
def max_rss():
return resource.getrusage(
resource.RUSAGE_SELF,
).ru_maxrss
prev_result = None
def mem_delta(prefix=None):
global prev_result
subkeyword = (
Foo.something()
.something_else()
.more_stuff(bar)
.more_stuff(
omg,
so,
many,
args,
)
@pkoch
pkoch / gist:1903728
Created February 24, 2012 21:03 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1903728)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
# Stop on errors
set -e
echo "Downloading linecache19-0.5.13"
curl -sS -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
@pkoch
pkoch / enumerable_collate.gemspec
Created June 3, 2012 19:10 — forked from hugopeixoto/enumerable_collate.gemspec
Allows for iteration of multiple enumerables
Gem::Specification.new do |s|
s.name = 'enumerable_collate'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY
s.author = 'Hugo Peixoto'
s.email = 'hugo.peixoto@gmail.com'
s.summary = 'Enumerable Collate'
s.description = 'Allows for iteration of multiple enumerables'
s.files = ['enumerable_collate.rb']
INFO global: Vagrant version: 1.0.5
INFO vagrant: `vagrant` invoked: ["up"]
DEBUG vagrant: Creating Vagrant environment
INFO environment: Environment initialized (#<Vagrant::Environment:0x00000100998828>)
INFO environment: - cwd: /Users/pkoch/Desktop/movercado
INFO environment: Home path: /Users/pkoch/.vagrant.d
INFO plugin: Searching and loading any available plugins...
INFO plugin: Loading plugin: vagrant-vbguest (0.6.0.pre3)
INFO plugin: Loaded 1 plugins.
DEBUG vagrant: Loading environment
commit ab936ee7223dc2fff4202c8b188f7c76089837d9
Author: Paulo Koch <pkoch@yelp.com>
Date: Thu Mar 17 16:51:33 2016 -0700
fixup! Disambiguate packages with same filename
diff --git a/pypicloud/cache/dynamo.py b/pypicloud/cache/dynamo.py
index 1046312..82a895d 100644
--- a/pypicloud/cache/dynamo.py
+++ b/pypicloud/cache/dynamo.py

Keybase proof

I hereby claim:

  • I am pkoch on github.
  • I am pkoch (https://keybase.io/pkoch) on keybase.
  • I have a public key whose fingerprint is 0C32 8043 1F71 A6AC DDFB ECD5 60F3 4D10 654B A5EC

To claim this, I am signing this object:

http://www.changeip.com/accounts/dl.php?type=d&id=14
Coopérnico
Si: 365 * (0,1541 * 3 + 0,1326) = 217,14
Bi: 365 * (3 * (10 * 0,0968 + 14 * 0,1904)/24 + 0,1326) = 214,18
YLCE
Si: 365 * (0,1551 * 3 + 0,1326) = 218,23
Bi: 365 * (3 * (10 * 0,0978 + 14 * 0,1914)/24 + 0,1326) = 215,28
EDP - Casa click
Si: 365 * (0,1536 * 3 + 0,1585) = 226,04
import json
def slurp_entries(file_name):
return [json.loads(l) for l in open(file_name).readlines()]
def truque(file_name):
"""
Identify users that retweet stuff within one second of its publishing date