Skip to content

Instantly share code, notes, and snippets.

View tigerhawkvok's full-sized avatar

Philip Kahn tigerhawkvok

View GitHub Profile
@tigerhawkvok
tigerhawkvok / RUNME.bat
Last active August 29, 2015 14:01
Infinite screenshots
python infinite_screenshots.py
pause
@tigerhawkvok
tigerhawkvok / FCCLetter.md
Last active August 29, 2015 14:01
Letter to the FCC

I'm sorry to say your proposed rules are a farce.

You claim:

If the network operator slowed the speed below that which the consumer bought it would be commercially unreasonable and therefore prohibited. If a network operator blocked access to lawful content it would violate our no-blocking rule and be commercially unreasonable and therefore be doubly prohibited.

Except you must have no concept of the weasel-words that ISPs use. You cannot buy bandwidth in the US. You buy "up-to" bandwidth. 1 kbps is still "up to" 1 Gbps. A two-tiered, have-and-have-not interent is absolutely allowed in your proposal.

ISPs say:

@tigerhawkvok
tigerhawkvok / Cakefile
Last active August 29, 2015 14:01
Cakefile
# Snatched and tweaked from
# https://gist.github.com/jrmoran/1537200
fs = require 'fs'
{exec, spawn} = require 'child_process'
# order of files in `inFiles` is important
config =
srcDir: 'coffee'
outDir: 'js'
@tigerhawkvok
tigerhawkvok / loadJQuery.js
Last active August 29, 2015 13:57
If jQuery isn't already loaded, keep trying with fallbacks.
/***
* See https://gist.github.com/tigerhawkvok/9673154 for the latest version
* Put any functions you want to load at the very end in a public function named loadLast().
***/
function cascadeJQLoad(i) { // Use alternate CDNs where appropriate to load jQuery
if (typeof(i) != "number") i = 0;
// the actual paths to your jQuery CDNs. You should also have a local version here.
var jq_paths = [
"ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js",
@tigerhawkvok
tigerhawkvok / _quinput.py
Last active February 26, 2019 21:58
Cross-Platform Python getch, with a Y/N module for interpreter prompts.
"""
Python 2 and Python 3 input wrapper with helper Yes/No class for feedbackless boolean input
@author Philip Kahn
@date 2016
"""
class _qinput:
"""Take care of the changes in inputs between Python 2 and 3, as well as enabling a getch-like functionality"""
def __init__(self):
try:
@tigerhawkvok
tigerhawkvok / stringify.js
Last active December 27, 2015 23:39
Stringify implementation -- played with after speaking with Andrew about it
function stringify(o) {
var c=new Array;
$.each(o,function(key,val){
if(typeof(val)!='object' || Array.isArray(val)) c.push(clean(key)+':'+clean(val));
else c.push(clean(key)+':'+stringify(val));
});
return "{"+c.join(",")+"}";
}
function clean(string) {
return escape(string).split('"').join('\"');