Skip to content

Instantly share code, notes, and snippets.

View joar's full-sized avatar
:bowtie:
Not wearing a bowtie

Joar Wandborg joar

:bowtie:
Not wearing a bowtie
View GitHub Profile
import sys
from itertools import permutations
print(len(list((lambda n: (lambda cols: (True for vec in permutations(range(n)) if n == len(set(vec[i]+i for i in cols)) == len(set(vec[i]-i for i in cols))))(range(n)))(int(sys.stdin.readline())))))
# Requires fish 2.2b1 or later for the "abbr" command.
abbr -a ga="git add"
abbr -a gc="git commit"
abbr -a gco="git checkout"
abbr -a gst="git status"
abbr -a gl="git pull"
abbr -a gp="git push"
abbr -a gu="git up"
abbr -a s="git status -sb"
abbr -a l="git log"
@joar
joar / README.md
Last active August 29, 2015 14:23
Print Your Tacos

Usage:

curl -O https://gist.githubusercontent.com/joar/3618b29180ab0ff67ac7/raw/tacofont.py
python tacofont.py taco
🐓🌮🌮🌮🌮🌮🐓🐓🌮🌮🌮🐓🐓🌮🌮🌮🌮🌮🐓🌮🌮🌮🌮🌮🐓
🐓🐓🐓🌮🐓🐓🐓🌮🐓🐓🐓🌮🐓🌮🐓🐓🐓🐓🐓🌮🐓🐓🐓🌮🐓
🐓🐓🐓🌮🐓🐓🐓🌮🌮🌮🌮🌮🐓🌮🐓🐓🐓🐓🐓🌮🐓🐓🐓🌮🐓
🐓🐓🐓🌮🐓🐓🐓🌮🐓🐓🐓🌮🐓🌮🐓🐓🐓🐓🐓🌮🐓🐓🐓🌮🐓
🐓🐓🐓🌮🐓🐓🐓🌮🐓🐓🐓🌮🐓🌮🌮🌮🌮🌮🐓🌮🌮🌮🌮🌮🐓
@joar
joar / socker_auth.py
Created June 11, 2015 09:52
Socker auth pseudocode
import yourapp
AUTH_BACKENDS = [
yourapp.socker_auth
]
def socker_handle_connect(client):
while True:
msg = client.wait_for_message()

trak

Multi-party ticket handling and coordination.

Develop

import time
import logging
import os
from collections import namedtuple
import cv2
import numpy as np
from matplotlib import pyplot as plt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import time
import logging
import os
from collections import namedtuple
import cv2
import numpy as np
from matplotlib import pyplot as plt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joar
joar / transcode-avi.sh
Last active August 29, 2015 14:21
GStreamer multiple output transcoding with deduplication of media streams.
#!/bin/bash
# Note: use x264enc tune=zerolatency or bigger queues
# NOT WORKING! stalled at prerolling
gst-launch-1.0 filesrc location=VfE.webm ! decodebin name=dmux \
dmux. ! videoconvert ! tee name=vo \
dmux. ! audioconvert ! tee name=au \
webmmux name=webm ! progressreport name=webmprogress ! filesink location=out.webm \
avimux name=avi ! progressreport name=aviprogress ! filesink location=out.avi \
vo. ! queue ! vp8enc ! webm. \