Skip to content

Instantly share code, notes, and snippets.

View shmup's full-sized avatar
🐌

Jared Miller shmup

🐌
View GitHub Profile
@shmup
shmup / pagat_bookmarklet.txt
Created December 11, 2014 22:08
a bookmarklet to print for pagat
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3B%24(".header").remove()%3B%24("ul%3Afirst").remove()%3B%24(".breadcrumb").remove()%3B%24(".footer").remove()%3B%24("*").css("font-family"%2C "sans-serif").css("font-size"%2C "9pt")%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
@shmup
shmup / mp3_duration.sh
Created December 10, 2014 20:44
Find your average mp3 duration
find . -name "*.mp3" -print0 | xargs -0 mp3info -p "%S\n" | awk '{s+=$0} END {printf "count: %u\naverage length: %.2f seconds\n", NR, s/NR}'
@valerysntx
valerysntx / gist:809d0a63d49f46cb5bcc
Created December 8, 2014 10:10
lite knockout.js
ko = {};
ko.Observable = function(value) {
this.value = value;
this.subscribers = [];
};
ko.Observable.prototype.get = function() {
return this.value;
};
#!/usr/bin/env python
import random
CHARS = {
'top': [
u'\u0300',
u'\u0301',
u'\u0302',
u'\u0303',
@shmup
shmup / fall_of_detroit.md
Last active July 1, 2016 15:37
The Fall of Detroit

Detroit is founded in 1701 as a trading outpost on the edge of the Detroit River, first main terminus on the westward expansion.

Detroit rises in power as a logging hub, the vast deciduous and northern coniferous forest are leveled and shipped by boat back east, creating the original fortunes of the city.

The late 1800s saw a growing city often called the Paris of the West. Major building projects began in the city's hub and rail lines were routed to Detroit from the east through Canada and out to Chicago. The lumber barons were investing in real estate and the architecture of the time reflects magnificently. The hub and spoke road system is adopted, but crucially is not rigidly adhered to. Main line roads radiate from the downtown hub, but secondary roundabouts and opposite diagonals are not constructed.

At the turn of the century, the auto industry explodes. Albert Kahn creates an architectural model still in use today that allows for rapid construction of space-efficient factories. Factories are built a

@thischarmingsam8
thischarmingsam8 / IdleTimer.coffee
Created April 26, 2014 11:44
Coffeescript version of the simple page idle timer.
class window.IdleTimer
constructor: () ->
@timer
@timeIncrement = 1000
@timeIdle = 0
@timeMax = 10000
@expired = false
@interactionMethods = ['click','mousemove']
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@vivien
vivien / imgur
Last active January 27, 2022 19:46
Shell script to upload image(s) to imgur.com
#!/bin/sh
#
# Upload image(s) to imgur.com
# Copyright (C) 2014 Vivien Didelot <[email protected]>
# Licensed under GPL version 3, see http://www.gnu.org/licenses/gpl.txt
#
# Requires "jshon":
# http://kmkeen.com/jshon/
#
# Alternatives, which suck:
# let's assume the command is:
# sshcd -v -q [email protected]:/path/to/file
# grabs the last argument of command, the target: "[email protected]:/path/to/file
t="${!#}"
# command to run, which I've broken down line by line
c=(
"ssh"
"-t" # force pseudo-tty allocation (http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1)
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell