I hereby claim:
- I am pkqk on github.
- I am pkqk (https://keybase.io/pkqk) on keybase.
- I have a public key whose fingerprint is 3B93 48C9 29A5 3871 B646 3902 1261 8403 E5AF 379E
To claim this, I am signing this object:
# for each match that is a directory with a git repo in it | |
for dir in */.git | |
do | |
# change into directory | |
# dirname gets rid of the .git | |
# quotes around $dir in case a name with spaces comes along | |
pushd `dirname "$dir"` | |
# fetch new updates | |
# but only pull them into your branch if you haven't changed anything | |
git fetch && git pull --ff-only |
I hereby claim:
To claim this, I am signing this object:
function timeout(callback, wait) { | |
var cancel = window.setTimeout(callback, wait); | |
return function() { | |
window.clearTimeout(cancel); | |
} | |
} | |
cancel_the_timeout = timeout(function() { alert("hi") }, 3600); | |
cancel_the_timeout(); |
require 'rspec/core/rake_task' | |
RSpec::Core::RakeTask.new(:spec) do |task| | |
task.pattern = "spec/**/*_spec.rb" | |
end |
import sys | |
def process_lines(lines): | |
last_line = None | |
for line in lines: | |
if line != last_line: | |
sys.stdout.write(line) | |
last_line = line | |
process_lines(sys.stdin.readlines()) |
cocktails = [ | |
(1, 'This is a name'), | |
(2, 'The beauty beneath'), | |
(3, 'woo woo'), | |
(4, 'martinez'), | |
(5, 'the crow cocktail'), | |
(6, 'charlie chaplain cocktail'), | |
(7, 'gin n it') | |
] |
database: &database | |
adapter: # your database | |
hostname: localhost | |
username: root | |
password: | |
encoding: utf8 | |
development: | |
<<: *database | |
<% branch_name = `git symbolic-ref HEAD`.strip.split('/')[-1] %> |
class User(object): | |
def __init__(self, email, password, brands, dashboardbrands, allBrands, active=True): | |
self.email = email | |
self.password = password | |
self.brands = brands | |
self.dashboardbrands = dashboardbrands | |
self.allBrands = allBrands | |
self.active = active | |
class NormalUser(User): |
""" | |
Safely deal with unicode(utf-8) in csv files | |
removing nasty BOM surprises | |
""" | |
import csv | |
import codecs | |
# an attempt to make filter, exclude, chainable | |
# based on: http://zmsmith.com/2010/04/using-custom-django-querysets/ | |
# https://code.djangoproject.com/ticket/16748 | |
# http://djangosnippets.org/snippets/734/ | |
from django.db import models | |
from django.db.models.query import QuerySet | |
from datetime import date, timedelta |