Skip to content

Instantly share code, notes, and snippets.

@passcod
passcod / yaml.tmpl
Created August 24, 2014 12:20
Template file to dump docker-gen's output in YAML format
---
{{ range $_, $cont := $ }}
{{ $addrLen := len $cont.Addresses }}
{{ $envLen := len $cont.Env }}
{{ $regLen := len $cont.Image.Registry }}
- id: "{{ $cont.ID }}"
{{ if eq $addrLen 0 }}
addresses: ~
{{ else }}
addresses:
anonymous
anonymous / rss_proxy.cgi.sh
Created August 10, 2014 10:01
rss_proxy.cgi
#!/bin/bash
PATH="/mnt/data/www/temp_rss/"
DATE=/bin/date
STAT=/usr/bin/stat
SED=/bin/sed
TOUCH=/usr/bin/touch
EXECPATH="/mnt/data/www/rss_proxy"
TERM=""
if [ -z "$QUERY_STRING" ] || [[ $QUERY_STRING == url* ]]
then
anonymous
anonymous / rss_proxy.d.d
Created August 10, 2014 09:57
rss_proxy.d
module rss_proxy;
import tools.base, std.file, tools.downloader;
string download(string url) {
char* tmpfilp = tmpnam(null);
if (!tmpfilp) throw new Exception("could not get temp file name");
auto tmpfil = toString(tmpfilp);
scope(exit) unlink(toStringz(tmpfil));
if (system(toStringz("/usr/bin/wget --timeout=60 -q -O \""~tmpfil~"\" \""~url~"\"")) == -1) {

Music for Making

Félix Saparelli

  • Anthony Gonzales
    • Tech 49
  • Antonín Dvořák
    • Allegro con fuoco ("From The New World")
  • Antonio Vivaldi
    • The Four Seasons: Concerto N°2 in G Minor, RV315, "Summer": I. Allegro non molto
  • Apocalyptica
@passcod
passcod / MOVE.md
Last active August 29, 2015 13:56
firefox-always-nightly in the AUR
anonymous
anonymous / stdin.txt
Created October 27, 2013 05:32
stdin
0 0 0 1 1 1 2 0 0
3 6 9 2 5 8 1 0 3
-------------------------------------------------
. ┝━━━━━━━━━━━━━┥. . . . . .
. ┝━━━━━━━━━━━━━━━━┥ . . . . .
. ┝━━━━━━━━━━━━━━━━━┥. ┝━━┥ . . .
. .┝━━━━━━━━━━┥ . . . . .
. ┝━━━━━━━━━━━━━━┥ . . . . .
. ┝━━━━━━━━━━━━┥ . . . ┝━━━━┥ . .
. . ┝━━━━━━━━━━━━━┥ . . . .
@relsqui
relsqui / examples.txt
Last active September 28, 2017 03:55
Older versions of the PSU out list don't have great spacing, so the identity labels and the academic fields sort of run together. The result is funny. Rather than standing in the QRC reading the out list and giggling, here's a script to generate them.
C:\home\relsqui\queermajors> ./pickmajor.py
polyamorous music
C:\home\relsqui\queermajors> ./pickmajor.py
androgynous spanish
C:\home\relsqui\queermajors> ./pickmajor.py
genderfluid pre-health
C:\home\relsqui\queermajors> ./pickmajor.py
intersex music composition
C:\home\relsqui\queermajors> ./pickmajor.py
gay chemistry
@passcod
passcod / music-for-making.markdown
Created September 17, 2013 08:35
My playlist for moments of epic creativity

Music for Making

Air Traffic Controller

  • Can't Let Go

Apocalyptica

  • Quutamo
@hamishcampbell
hamishcampbell / polyomino.py
Created September 6, 2013 23:26
Polyomino Reference Source - PyCon 2013
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import sys
class Polyomino(object):
def __init__(self, iterable):
self.squares = tuple(sorted(iterable))
def __repr__(self):
@passcod
passcod / extend.coffee
Last active December 21, 2015 17:29
This is really normal prototypal inheritance, and the #extend and #create methods are just there for convenience, not to hide away the magic.
Namespace.extend = (src, obj = {}) ->
if typeof obj.init is 'function'
newObj = obj.init
delete obj.init
else
newObj = ->
newObj.prototype = Object.create src.prototype
newObj.prototype.constructor = newObj
for prop of obj