This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
# Author: David Underhill | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
# | |
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/ | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use C-a, since it's on the home row and easier to hit than C-b | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
set -g base-index 1 | |
# vi is good | |
setw -g mode-keys vi | |
set-option -g default-terminal screen-256color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A javascript DOM application framework API that just feels right. | |
// TODO: please build this into an actual framework for me. KTHXBYE. | |
App('chat', function(selection){ | |
// anything you want to run at | |
// initialization you can add here | |
selection.click(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
DIR = File.expand_path(__dir__) | |
module Deprecations | |
extend self | |
PATTERN = /DEPRECATION WARNING: (?<message>.*) \(called from (?<source_method>.+) at (?<source_file>[\w\.\/]+):(?<source_line>\d+)/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script works on OS X with Homebrew Given a specific MySQL version this | |
# script will ensure that version is installed, nothing incompatible is | |
# blocking it from working, and the mysqld process responds to queries. | |
# | |
mysql_version=$1 | |
if [[ -z "${mysql_version}" ]]; then | |
echo "USAGE: ${0} MYSQL_VERSION_THAT_HOMEBREW_RECOGNIZES" | |
echo "example: ${0} mysql@5.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function listDocs() { | |
var folderid = '{any folder id}'; | |
var folder = DriveApp.getFolderById(folderid) | |
var contents = folder.getFiles(); | |
var file; | |
var files = []; | |
while(contents.hasNext()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def whereami(): | |
import traceback | |
for stack_frame in traceback.extract_stack(): | |
if stack_frame[3] == 'from IPython.terminal.embed import embed; embed()': | |
line = stack_frame[1] | |
file = stack_frame[0] | |
break | |
if not line: | |
raise Exception("couldn't figure out the line number") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In your code, right at the top of any source code file. | |
trap 'PROF' do | |
File.open("/tmp/profile-#{Time.current.to_f}", 'w') {|f| f.write caller(2).join("\n") } | |
pid = $$ | |
Thread.new { sleep 0.5; `kill -PROF #{pid}` } | |
end | |
# in a terminal | |
while true; do | |
sleep 0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Injectable | |
class Placeholder | |
def initialize(target) | |
@target = target | |
end | |
def injected_value | |
@target.generate | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Square Software Engineer, Foundation Server | |
Behind the teams that build new features for our millions of merchants there is | |
a group that builds tools and services to make the product teams' work easier. | |
We work in every software language and at every layer in the technology stack – from | |
client to api to server to database. Our mission is to serve the engineers of Square | |
and, by extension, all the small business owners who need a simple and powerful | |
payment system. You don't have to know these languages or technologies but you do | |
need to be willing to learn. |
NewerOlder