Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gist:5308457
Created April 4, 2013 07:13
Binary-to-url benchmark in node.js
#!/usr/bin/env node
var fs = require('fs');
var re = /(..)/g;
var methods = {
with_escape: function(data) {
return escape(data.toString('binary'));
},
with_loop: function (data) {
@passcod
passcod / attention
Last active December 15, 2015 23:58
Obfuscated
Google's Closure Compiler
throws up if you give it this.
Just sayin'
anonymous
anonymous / dump
Created May 3, 2013 13:05
7 generations of git://github.com/tbranyen/nodegit.git
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0~ ## ####
1~ # ## ###
2~ ######
3~ # # ## #
4~ # ####
5~ # # #
6~ ##
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@passcod
passcod / hookz.rb
Created August 15, 2013 04:10 — forked from anonymous/hookz.rb
Hookz: Lolcommits plugin to execute custom hooks. Place an executable (shell script, binary, something else with a shebang...) in ~/.lolcommits/project-name/Hookfile, and it will be called every time a commit picture is taken, with its path as argument. Use for anything you can't be bothered writing Ruby for: posting to tumblr, sending email, up…
module Lolcommits
class Hookz < Plugin
def initialize(runner)
super
self.name = 'hookz'
self.default = true
end
def run
@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
@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
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
@achanda
achanda / dotexec.md
Last active March 8, 2018 03:52
Dot execing Rust
  • Wrapper script
root@dev:~# cat `which rustwrap`
#!/usr/bin/env bash

rustc "$1" -o foobar && shift && ./foobar "$@"
  • Mount binfmt_misc
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
@hillexed
hillexed / portalexplanation.md
Last active June 16, 2019 23:30
BABA has PORTAL GUN

Here's how my level implementing Portal in Baba is You works! If you haven't seen it, here's a video: https://streamable.com/9pflr

Baba is You is a game played with the arrow keys. How can Baba fire a portal gun and still have the ability to walk around? The answer: there's one more button the game allows, and that's the wait button - which makes baba stand still and allows a turn to pass in the game world. In this level, the wait button does more than wait - it fires the portal gun.

The skull crosses are a gadget to activate an arbitrary rule when the wait button is pressed. The following rules are used to set it up:

FUNGUS MAKE BABA
BABA ON FUNGUS IS MOVE AND MOVE
BABA ON SKULL IS EMPTY