Skip to content

Instantly share code, notes, and snippets.

View ryanbraganza's full-sized avatar
🔂

Ryan Braganza ryanbraganza

🔂
View GitHub Profile
@ryanbraganza
ryanbraganza / Git branch bash autocomplete *with aliases*
Created January 8, 2017 19:03 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases

Keybase proof

I hereby claim:

  • I am ryanbraganza on github.
  • I am ryanbraganza (https://keybase.io/ryanbraganza) on keybase.
  • I have a public key ASBMNbM2SuuquqRXXZ5pizf9-cK3G82p9CmyKzcPXhfNTgo

To claim this, I am signing this object:

#!/usr/bin/env ruby
# Usage:
#
# ruby connect4.rb test # run the tests
# ruby connect4.rb play # launch a CLI-based game
# ruby connect4.rb # Simulate a simple game
require 'set'
PLAYER_ONE = 'X'
@ryanbraganza
ryanbraganza / TwentyTwo.rb
Created July 25, 2015 19:15
partial tswift 22
module Deferredness
def defer phrase
thread = Thread.new do
sleep 0.0001 # FIXME hax
puts ' if ' + phrase
end
threads << thread.run
end
def await
@ryanbraganza
ryanbraganza / csv.vim
Last active December 10, 2015 20:38
viewing csv files with vim
# select entire file
# filter through column (separator: s, pretty-print to a table)
ggvG:!column -s, -t
@ryanbraganza
ryanbraganza / cindy.py
Created January 3, 2013 00:00
django management command to greet cindy
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
class Command(BaseCommand):
args = "<how many times to say hi to cindy>"
help = "Says hi to Cindy"
option_list = BaseCommand.option_list + (
make_option('--with-smily-face',
@ryanbraganza
ryanbraganza / expand_shell_aliases.vim
Last active October 14, 2015 00:57
vim exec expand shell aliases
set shellcmdflag=-O\ expand_aliases\ -lc
set shellcmdflag=-c
@ryanbraganza
ryanbraganza / md-preview.sh
Created November 9, 2012 03:38
markdown preview
#!/bin/bash
# tested in ubuntu 12.04
# sudo apt-get install markdown
filename="/tmp/md-preview-`date +%Y%m%d%H%M%S_%N`"
markdown $1 > "$filename"
firefox "$filename" &
@ryanbraganza
ryanbraganza / repl.py
Last active October 11, 2015 08:37
start a python interactive console
import code
code.InteractiveConsole(locals=locals()).interact()
# with completion..
import readline
readline.parse_and_bind("tab: complete")
@ryanbraganza
ryanbraganza / djangoshelllogging.py
Last active August 26, 2022 19:18
enable django logging in a django shell
import logging; l=logging.getLogger('django.db.backends');l.setLevel(logging.DEBUG);l.addHandler(logging.StreamHandler())