Skip to content

Instantly share code, notes, and snippets.

View Fishrock123's full-sized avatar
💭
#freepalestine #blacklivesmatter #acab drop ICE you cowards

Jeremiah Senkpiel Fishrock123

💭
#freepalestine #blacklivesmatter #acab drop ICE you cowards
View GitHub Profile
@Fishrock123
Fishrock123 / alphaSortJSON.js
Created December 23, 2013 17:51
Sorts a JSON Object file alphabetically.
var specs = require('./Your_Json_File_Here.json')
, out = {}
, fs = require('fs')
function iterateObjectAlphabetically(obj, callback) {
var arr = []
, i
for (i in obj) {
if (obj.hasOwnProperty(i)) {
@Fishrock123
Fishrock123 / log.txt
Created December 28, 2013 03:20
node-core-audio compile errors.
/Users/Jeremiah/Documents/node-voicechat
Jeremiahs-MacBook-Pro:node-voicechat Jeremiah$ npm install node-core-audio-0.3.5.tgz
npm WARN package.json node-voicechat@0.0.0 No repository field.
npm WARN package.json node-voicechat@0.0.0 No README data
npm http GET https://registry.npmjs.org/audio-streamer
npm http GET https://registry.npmjs.org/fft
npm http GET https://registry.npmjs.org/portfinder/0.2.1
npm http 200 https://registry.npmjs.org/portfinder/0.2.1
npm http 200 https://registry.npmjs.org/audio-streamer
npm http GET https://registry.npmjs.org/portfinder/-/portfinder-0.2.1.tgz
// Site 404
app.use(function(req, res, next) {
res.status(404)
if (req.accepts('html')) {
res.type('html')
res.render('404', {
url: req.get('host') + req.url,
user: req.user,
version: version

Keybase proof

I hereby claim:

  • I am fishrock123 on github.
  • I am fishrock (https://keybase.io/fishrock) on keybase.
  • I have a public key whose fingerprint is FD3A 5288 F042 B685 0C66 B31F 09FE 4473 4EB7 990E

To claim this, I am signing this object:

@Fishrock123
Fishrock123 / sublime-settings.json
Created April 14, 2014 22:04
My Sublime Text 2 settings. (14 / 04 / 2014)
{
"auto_complete_triggers":
[
{
"characters": "<."
}
],
"bold_folder_labels": false,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
@Fishrock123
Fishrock123 / pixi.TextInput.js
Created May 16, 2014 20:20
TextInput Element for pixi.js
/**!
* name: pixi.TextInput.js
* repository: https://gist.github.com/Fishrock123/7ce7da8cacd762a56542
* @author Jeremiah Senkpiel - https://searchbeam.jit.su
* @version 0.2
* MIT Licensed - Copyright 2013 Jeremiah Senkpiel
*/
(function(){
@Fishrock123
Fishrock123 / thing.js
Last active August 29, 2015 14:01
not thunkifying correctly or something (fixed)
var co = require('co')
var readln = require('readline')
var rl = readln.createInterface({
input: process.stdin
, output: process.stdout
})
// make rl.question a thunk
function confirm(question) {
@Fishrock123
Fishrock123 / lengthOfBytes.swift
Last active August 29, 2015 14:02
Counts the average byte length in a unicode string. (lol)
// assuming utf-8 where characters are "normally" 1 byte (so the byte's default length is 8 bits.)
import Cocoa
func lengthOfBytes(s: String) -> Double {
let count = Double(countElements(s))
let bytes = Double(s.lengthOfBytesUsingEncoding(NSUTF8StringEncoding))
let extra = (bytes - count) / count
return 8 * (1.0 + extra)
// Returns a non-leaking, optimizable, safe close of `arguments`
// usage: var args = clone_args.apply(this, arguments)
module.exports = function clone_args() {
var i = arguments.length
var clone = new Array(i)
while (i--) clone[i] = arguments[i]
return clone
document.addEventListener('keydown', function (event) {
if (!/INPUT|SELECT|TEXTAREA/i.test(event.target.tagName)) {
event.preventDefault()
}
})