Skip to content

Instantly share code, notes, and snippets.

View snahor's full-sized avatar

Hans Roman snahor

  • Wakanda
View GitHub Profile
@snahor
snahor / disqus_requirements.txt
Created May 12, 2012 19:54 — forked from kracekumar/disqus_requirements.txt
disqus requirements.txt
# dev
django-debug-toolbar==0.9.4
django-data-tools==0.1
django-devserver==0.3
nashvegas==0.8-disqus-5
Sphinx>=1.0.7
piplint==0.1.1
# global
amqplib==1.0.0
from threading import Thread
import cProfile
import pstats
def enable_thread_profiling():
'''Monkey-patch Thread.run to enable global profiling.
Each thread creates a local profiler; statistics are pooled
to the global stats object on run completion.'''
#!/bin/sh
sudo apt-get update
sudo apt-get install openjdk-6-jre
sudo apt-get install openjdk-6-jdk
sudo wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install ant
import hashlib
import base64
import hmac
import time
def _decrypt_cookie(name, value, cookie_secret, include_name=True):
def _cookie_signature(*parts):
hash = hmac.new(cookie_secret,
digestmod=hashlib.sha1)
@snahor
snahor / readme.md
Last active August 29, 2015 14:15 — forked from ukd1/readme.md

Given an array of positive integers, write a function which returns all the unique pairs which add (equal) up to 100.

Example data:

sample_data = [0, 1, 100, 99, 0, 10, 90, 30, 55, 33, 55, 75, 50, 51, 49, 50, 51, 49, 51]
sample_output = [[1,99], [0,100], [10,90], [51,49], [50,50]]