Skip to content

Instantly share code, notes, and snippets.

View okofish's full-sized avatar

Jesse Friedman okofish

View GitHub Profile
require 'formula'
class Sk1libs < Formula
homepage 'http://sk1project.net/modules.php?name=products&product=sk1&op=download'
url 'https://sk1project.net/dc.php?target=sk1libs-0.9.1.tar.gz'
depends_on 'lcms2'
# educate sk1libs about Mac OS X fonts directories
def patches; DATA; end
@okofish
okofish / ytr2015annotations
Created December 9, 2015 19:05
Annotations from the YouTube Rewind 2015 video
https://www.youtube.com/trending
https://www.youtube.com/watch?v=ueu7Fp_9sTc
https://www.youtube.com/watch?v=JXB1SvD7F44
https://www.youtube.com/watch?v=Fflody75u9g
https://www.youtube.com/watch?v=1luLkPih8so
https://www.youtube.com/watch?v=j6m5WSm6Gso
https://www.youtube.com/watch?v=10TQrm1GB2s
https://www.youtube.com/watch?v=aWj1vgl08-g
https://www.youtube.com/watch?v=b41AL-lamdI
https://www.youtube.com/watch?v=HjM7x8s-Vuk
@okofish
okofish / .htaccess
Last active August 29, 2015 14:25
Geek Code age auto-updater
RewriteEngine on
RewriteBase /
RewriteRule ^geekcode.txt geekcode.php [L] # geek code
# people usually place their Geek Code in a txt file, so this silently redirects geekcode.txt to geekcode.php.
# if you already have RewriteEngine and RewriteBase set in your .htaccess, just place the RewriteRule directly below them.
@okofish
okofish / yikyakUA.js
Last active August 29, 2015 14:23
Yik Yak user-agent generator, adapted from https://github.com/soren121/yodel/
var crypto = require('crypto')
function genRandom4DigitHex(num) {
var arr = [];
// Decrement num by one to align with zero-indexed array
num--;
for (var cur = 0; cur <= num; cur++) {
// Get a chunk of the crypto buffer and force to string
var ret = (Math.random()*0xFFFF<<0).toString(16)
eb8f1faa02dfd12a7c359aba1554dae5ae5c15c4bb3346d778cd09b093dbd97f0e93e6b00978610a6baee8ceafb1c177bfa77f640659776349dbdb2ab4258e3195d460552e85e0d8a70495b201eaa710f43a095ea2fce0b9eeb4394e8647bd4ff8372831fbb8a4279b477e5a6cb631cb
@okofish
okofish / cmd.bro
Last active January 25, 2019 06:16
i had some trouble finding info on running shell commands in bro, so i thought i'd share what i found
##! cmd.bro
##! runs shell commands with bro
## just replace ls with your command
## the script runs fine alone, or you can wrap it in a notice
local cmd = fmt("ls");
piped_exec(cmd, fmt(""));
//This event appears to ping xkcd's servers when various things happen
//Probably for serverside logging/analytics/debugging/statistics
function ping_event(evt_name) {
(new Image).src = "http://xkcd.com/events/" + evt_name
}
//This function ouputs debug info into the javascript console if the URL has a "#verbose" anchor appended
function log() {
location.hash == "#verbose" && console.log.apply(console, arguments)
}
//A list of event streams to choose from at random, for load balancing
(function (a) {
a.browserTest = function (e, g) {
var f = "unknown",
d = "X",
b = function (k, j) {
for (var c = 0; c < j.length; c = c + 1) {
k = k.replace(j[c][0], j[c][1])
}
return k
},