Skip to content

Instantly share code, notes, and snippets.

View shmup's full-sized avatar
🐌

Jared Miller shmup

🐌
View GitHub Profile
@razius
razius / chrome-refresh.sh
Last active November 6, 2018 13:50
Watches the folder or files passed as arguments to the script and when detects a change it automatically refreshes the current selected Chrome tab or window.
#!/bin/bash
#
# Watches the folder or files passed as arguments to the script and when it
# detects a change it automatically refreshes the current selected Chrome tab or
# window.
#
# http://razius.com/articles/auto-refreshing-google-chrome-on-file-changes/
#
# Usage:
# ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
# 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)
@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:
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@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']
@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

#!/usr/bin/env python
import random
CHARS = {
'top': [
u'\u0300',
u'\u0301',
u'\u0302',
u'\u0303',
@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;
};
@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}'