Skip to content

Instantly share code, notes, and snippets.

View matthewhartman's full-sized avatar

Matthew Hartman matthewhartman

View GitHub Profile
for f in *.gz; do
STEM=$(basename "${f}" .gz)
gunzip -c "${f}" > /THERE/"${STEM}"
done
@amaxwell01
amaxwell01 / resize_delay.js
Created December 3, 2012 23:52
window resize delay
// Run code on resize, but give it a slight delay so that we aren't always calculating it
$(window).resize( function() {
if( timer ) {
clearTimeout(timer);
}
var timer = setTimeout( function() {
// On Resize Code Goes Here
}, 100 );
@TexRx
TexRx / vanilla-not-jquery.js
Created June 5, 2013 04:44
Pure JS alternatives to common CSS class jQuery functions
function hasClass(elem, className) {
return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');
}
function addClass(elem, className) {
if (!hasClass(elem, className)) {
elem.className += ' ' + className;
}
}
@vshvedov
vshvedov / gist:1370650
Created November 16, 2011 17:00
Sublime Text Edit 2 for Debian (from PPA)
wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
sudo mv add-apt-repository.sh.txt /usr/sbin/add-apt-repository
sudo chmod o+x /usr/sbin/add-apt-repository
sudo chown root:root /usr/sbin/add-apt-repository
sudo add-apt-repository ppa:webupd8team/sublime-text-2
@grindars
grindars / steam_bootstrap.sh
Created December 7, 2012 07:53
Steam installer for Debian
#!/bin/bash
#
# Steam installer for Debian wheezy (32- and 64-bit)
#
# Place into empty directory and run.
#
download() {
local url="$1"
local filename="$(basename "$url")"
@Kerrick
Kerrick / gist:2716568
Created May 17, 2012 05:08
HOWTO install Sublime Text 2 in Debian Squeeze
# Download Sublime Text 2 from http://www.sublimetext.com/2
# If you aren't root, sudo su
tar -xvjf Sublime\ Text\ 2*.tar.bz2
mv Sublime\ Text\ 2/ /opt/sublime-text-2/
ln -s /opt/sublime-text-2 /usr/local/sublime-text-2
ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text
rm Sublime\ Text\ 2*.tar.bz2
# Sublime Text 2 can now be run as normal user with command "sublime_text"
@elliotbonneville
elliotbonneville / topkeywords.js
Last active August 23, 2022 10:26
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@bradwestfall
bradwestfall / gist:f5a010e96fb0c4d18556
Last active November 20, 2022 14:40
Pull Instagram Images via JavaScript
@Lewiscowles1986
Lewiscowles1986 / goes in config file
Created April 7, 2017 13:29
Mupen 64 Plus DragonRise N64 USB Joystick
[Input-SDL-Control1]
# Mupen64Plus SDL Input Plugin config parameter version number. Please don't change this version number.
version = 2
# Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL Device, 2=Fully automatic
mode = 0
# Specifies which joystick is bound to this controller: -1=No joystick, 0 or more= SDL Joystick number
device = 0
# SDL joystick name (or Keyboard)
name = "DragonRise Inc. Generic USB Joystick "
@makenova
makenova / Difference between debounce and throttle.md
Last active February 22, 2023 03:09
Javascript function debounce and throttle

Difference between Debounce and Throttle

Debounce

Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.

Throttle