Skip to content

Instantly share code, notes, and snippets.

View atelic's full-sized avatar

Eric Barbour atelic

View GitHub Profile
// Checks or unchecks all checkboxes on a page
var setAllBoxes = function(value) {
var boxes = document.querySelectorAll('input[type="checkbox"]');
for(var i = 0; i < boxes.length; i++) {
boxes[i].checked = value;
}
}
@atelic
atelic / find_and_replace.sh
Last active September 3, 2015 14:09
Find and replace in all python files
find . -name '*.py' -print0 | xargs -0 perl -pie 's/foo/bar/g'
#!/usr/bin/perl
#
# Google Drive direct download of big files
# ./gdown.pl 'gdrive file url' ['desired file name']
#
# v1.0 by circulosmeos 04-2014.
# http://circulosmeos.wordpress.com/2014/04/12/google-drive-direct-download-of-big-files
#
use strict;
$(document).keydown(function(e) {
if (e.keyCode === 13) {
$target = $(e.target);
if ($target.hasClass('whatever-class')) {
var $button = $target.siblings('span').find('button');
if(!$button.is(':disabled')) {
$button.click();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.20784313976764679</real>
servers = (
{ address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; },
{
address = "irc.undernet.org";
chatnet = "Undernet";
port = "6667";
},
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
# Capitalized, short (50 chars or less) summary
# ----------------------------------------------|
#WIP:
#Add:
#Mod:
#Ref:
#Fix:
#Rem:
# More detailed description. Wrap at 70 characters
[core]
excludesfile = /Users/you/.gitignore
editor = emacsclient -t
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[user]
@atelic
atelic / README.md
Last active August 29, 2015 14:24 — forked from mattsears/README.md

Todo.rb

Todo.rb is a simple command-line tool for managing todos. It's minimal, straightforward, and you can use it with your favorite text editor.

Getting Started

Todo.rb doesn't require any third-party gems so you can copy the file anywhere and use it as long as it's executable:

@atelic
atelic / kill-tmux.sh
Created July 8, 2015 04:00
Kill tmux and all processes it spawned
tmux list-panes -s -F "#{pane_pid} #{pane_current_command}" | grep -v tmux | awk '{print $1}' | xargs kill -9