Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am alexggordon on github.
  • I am alexggordon (https://keybase.io/alexggordon) on keybase.
  • I have a public key whose fingerprint is CBE3 2BA0 3034 B3C3 C366 61BD 2835 C83F 45C1 9F32

To claim this, I am signing this object:

@alexggordon
alexggordon / deaf.sh
Last active August 29, 2015 14:03
A bash script to randomly change the volume on a Mac.
#!/bin/bash
ears ()
{
number=$RANDOM
number=$[ $number % 100 ]
osascript -e "set volume output volume $number"
}
@alexggordon
alexggordon / github-create
Last active August 29, 2015 14:04
Github ZSHRC Create Function
# taken from http://viget.com/extend/create-a-github-repo-from-the-command-line
function github-create() {
repo_name=$1
dir_name=`basename $(pwd)`
invalid_credentials=0
if [ "$repo_name" = "" ]; then
echo " Repo name (hit enter to use '$dir_name')?"
@alexggordon
alexggordon / map
Last active August 29, 2015 14:13
# I need to turn
[ {:class_fk => 1234, :criteria => "citizenship", :grade => "A"},
{:class_fk => 1234, :criteria => "effort", :grade => "B"} ]
# into
{ 1234 => {"citizenship" => "A", "effort" => "B"} }
@alexggordon
alexggordon / Big Comment.py
Created April 13, 2015 20:22
A Sublime Plugin for Inserting a Title-Like Sql Comment
import sublime
import sublime_plugin
import time
import threading
class InsertBigCommentCommand(sublime_plugin.TextCommand):
def run(self, args):
thread = BigComment(self.view, args)
thread.start()
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="crunch"
export VISUAL=/usr/bin/vim
@alexggordon
alexggordon / big-query-reddit.sql
Last active August 29, 2015 14:24
Big Query Most Downvoted Reddit Comment
SELECT score,
subreddit,
link_id,
body,
author
FROM [fh-bigquery:reddit_comments.2007],
[fh-bigquery:reddit_comments.2008],
[fh-bigquery:reddit_comments.2009],
[fh-bigquery:reddit_comments.2010],
[fh-bigquery:reddit_comments.2011],
// react code
render() {
let delta = this.props.delta ? (
<strong className={this.props.delta > 0 ? 'text-success' : 'text-danger'}>
{this.props.delta}
</strong>
) : null;
return (
<div className='card'>
@alexggordon
alexggordon / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@alexggordon
alexggordon / compile 1
Created September 23, 2015 15:17
Object Compilation Script
clang \
-DNDEBUG \
-g \
-fwrapv \
-O3 \
-Wall \
-Wstrict-prototypes \
-mmacosx-version-min=10.7 \
-I/Users/alexggordon/Documents/mysql-build/osx/py33-x86_64/staging/include \
-I/Users/alexggordon/Documents/mysql-build/osx/py33-x86_64/staging/include/openssl \