Skip to content

Instantly share code, notes, and snippets.

View bradsokol's full-sized avatar

Brad Sokol bradsokol

  • Toronto
  • 17:31 (UTC -05:00)
View GitHub Profile
#! /bin/bash
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
cd ~/.vim/bundle
git clone https://github.com/kien/ctrlp.vim.git
git clone https://github.com/scrooloose/nerdtree.git
git clone https://github.com/ervandew/supertab.git
git clone https://github.com/bling/vim-airline.git
@bradsokol
bradsokol / mkbox.sh
Created November 2, 2015 20:57
Generate Vagrantfile and provisioning files for various needs
#! /bin/bash -e
usage()
{
cat << EOF
usage: $0 [options...] box-name
Generates the files necessary to provision a virtual Ubuntu sever managed by Vagrant.
OPTIONS:
-d Install Docker
-m Install Mercurial
@bradsokol
bradsokol / pip.conf
Created January 31, 2014 20:46
Access local PyPI servers without extra command line args
# Put this in ~/.pip/
[global]
index-url = http://ops-build2.points.com:8000/pypi/
extra-index-url=http://pypi.points.com/simple
extra-index-url=http://pypi.python.org/simple/
@bradsokol
bradsokol / hgrc-confirm-push
Last active August 29, 2015 13:55
Mercurial Hook to Confirm Push
[hooks]
preoutgoing = bash -c 'read -p "Really push to $HG_URL? " -n 4 RESP ; [ "$RESP" == "yes" ]'
{
"translate_tabs_to_spaces": true
}
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"dictionary": "Packages/Language - English/en_GB.dic",
"font_face": "Source Code Pro",
"font_options":
[
"subpixel_antialias"
],
"font_size": 11,
"highlight_line": true,
@bradsokol
bradsokol / pyfind.sh
Last active December 12, 2015 12:09
Recursively find and grep all Python source files in a directory tree.
pyfind()
{
find . -name "*.py" -exec grep -Hn "$*" {} \;
}
@bradsokol
bradsokol / bash_prompt.sh
Last active January 6, 2024 07:36 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, Git, Mercurial or Subversion branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current Git, Mercurial or Subversion repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.