Skip to content

Instantly share code, notes, and snippets.

@corajr
corajr / builder.sh
Created December 21, 2014 20:21
SecurityTool dummy package
source $stdenv/setup
mkdir -p $out/bin
cp /usr/bin/security $out/bin
@corajr
corajr / install-nix.sh
Created December 20, 2014 21:26
Install Nix on Mac OS X 10.10 (Yosemite)
# current as of 2014-12-20
# mostly derived from https://nixos.org/wiki/Nix_on_OS_X#Using_the_Testing_Branch
curl https://nixos.org/nix/install | sh
NIXDIR=~/nixtest # or wherever you like
mkdir -p $NIXDIR
cd $NIXDIR
git clone https://github.com/joelteon/nixpkgs.git # this is the yosemite branch
nix-channel --remove nixpkgs
cd ~/.nix-defexpr
@corajr
corajr / Million Song Example.ipynb
Last active August 29, 2015 13:56
Million Song Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@corajr
corajr / myscript.js
Created February 27, 2014 00:54
Marianna Kreidler's "Jailbreak the Binary"
var searchFor = /\bshe\b|\bhis\b|\bher\b|\bhim\b|\bhe\b|\bms\b|\bmrs\b|\bmr\b|woman|\bman\b|women|\bmen\b|\bfemale|\bmale\b|\bmales\b|\bgirl\b|\bboy\b|\bgirls\b|\bboys\b|\bgirly\b|\bboyish\b|\bgirlhood\b|\bboyhood\b|\bgirlfriend|\bboyfriend|\bwife|\bhusband\b|\bwives\b|\bhusbands\b|daughter|\bson\b|\bsons\b|\bsister|\bbrother|\bmother|grandmother|godmother|stepmother|father|\baunt\b|\buncle\b|\baunts\b|\buncles\b|\bniece\b|\bnephew\b|\bnieces\b|\bnephews\b|\bherself\b|\bhimself\b|\blady|\bladies\b|\bgentlemen\b|\bgentleman\b|\bmom\b|\bdad\b|\bmoms\b|\bdads\b|mommy|daddy|mommies|daddies|ladiez|\bmenz\b|\bmanly\b|\bmanliness\b|\bmanhood\b|\bmankind\b|\bguy\b|\bguys\b|\bdude\b|\bdudes\b|\bdudely\b|\bmaternity\b|\bpaternity\b|\bmaternal\b|\bpaternal\b|\bmatroniz|\bpatroniz|\bmatronize|\bpatronize|klansman|airman|airmen|alderman|aldermen|anchorman|anchormen|assemblyman|assemblymen|bogeyman|bogeymen|bondsman|bondsmen|businessman|businessmen|cameraman|cameramen|caveman|cavemen|chairman|clergyman|congressman|congress
@corajr
corajr / gist:8888071
Created February 8, 2014 18:39
Hide link on MTurk
<!-- paste this at the top of your HIT's source -->
<script type="text/javascript">
function turkGetParam(name) {
name = name.replace(/[[]/,"\[").replace(/[]]/,"\]");
var regexS = "[?&]"+name+"=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null) {
return "";
@corajr
corajr / compare.py
Last active December 20, 2015 11:49
Genre classification test
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import os
from collections import defaultdict, Counter
comparisons = defaultdict(dict)
true_genres = {}
test_genres = {}
@corajr
corajr / index.html
Created April 4, 2012 03:56
Message Forum Tree
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Node-Link Tree</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<link type="text/css" rel="stylesheet" href="tree.css"/>
</head>
<body>
<div id="buttons">
<button class="depth first active" onclick="update(false)">Depth</button>