Skip to content

Instantly share code, notes, and snippets.

This is what people get when they mail you “offensive” stuff.
They layman wouldn’t know what’s going on and most glaringly there’s no “TEK Systems” or “Allegis” anything in here.
Just in case you hadn’t seen this before.
BTW the expression I used that got me filtered is increasingly common:
http://goo.gl/lcOHvG
http://goo.gl/Hm9T6k
; Quick miniKanren-like code
;
; written at the meeting of a Functional Programming Group
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic
; programming. The code is really quite trivial and unsophisticated:
; it was written without any preparation whatsoever. The present file
; adds comments and makes minor adjustments.
;
; $Id: sokuza-kanren.scm,v 1.1 2006/05/10 23:12:41 oleg Exp oleg $
#lang racket
;#lang web-server/insta
;(get-uri (calc g-i (car rings) cogs) (calc g-i (car (cdr rings)) cogs))
(define rings (list 38 50))
(define cogs (list 23 21 19 17 16 15 14 13 12 11))
(define max-x (/ 55 11.0))
(define axis (list 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0))
(define nums->csv
@irneh
irneh / gist:5568229
Last active December 17, 2015 06:49

1

2

One good sentence.

def randstr(length):
return ''.join(chr(random.randint(0,255)) for i in range(length))
def hash_password(password, maxtime=0.5, datalength=64):
return scrypt.encrypt(randstr(datalength), password, maxtime=maxtime)
def verify_password(hashed_password, guessed_password, maxtime=0.5):
try:
scrypt.decrypt(hashed_password, guessed_password, maxtime)
return True
ooh la la
#!/usr/bin/perl -wT
# Upgrade a PostgreSQL cluster to a newer major version.
#
# (C) 2005-2009 Martin Pitt <mpitt@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
expires = datetime.utcnow() + timedelta(days=(25 * 365))
expires = expires.strftime("%a, %d %b %Y %H:%M:%S GMT")
file.seek(0)
k.set_contents_from_string(file.read(), headers={
'Content-Type': 'image/jpeg',
'Cache-Control': 'public',
'Expires': expires,
})
@irneh
irneh / app.py
Last active August 29, 2015 14:25
Routing, database connection pooling, HTTP responses, sessions
import flask
import os
import psycopg2
import psycopg2.pool
app = flask.Flask(__name__)
app.secret_key = '@1*V*vpVqqfyhCZ)s/`5>B^V]mJ85]We'
app.debug = True
pool = psycopg2.pool.SimpleConnectionPool(
digraph g {
fontname = helvetica; fontsize = 10;
node [shape = record; fontname = helvetica; fontsize = 10];
edge [fontname = helvetica; fontsize = 10];
/* Documents */
doc0 [label = "<f0> parent_id|<f1> children|<f2> hierarchy|<f3> name|<f4> region"];
doc1 [label = "<f0> parent_id|<f1> children|<f2> hierarchy|<f3> name|<f4> region"];