Skip to content

Instantly share code, notes, and snippets.

Working from home

Tony Gaetani tonygaetani

Working from home
Block or report user

Report or block tonygaetani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View docker-clean-all.bash
#!/usr/bin/env bash
set -euo pipefail
# thank you
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
tonygaetani /
Created Jul 26, 2016
github keybase proof

Keybase proof

I hereby claim:

  • I am tonygaetani on github.
  • I am tonygaetani ( on keybase.
  • I have a public key whose fingerprint is 984C EC21 2057 94EF D296 AD3F 436F D09B AD04 F349

To claim this, I am signing this object:

View .basic.vimrc
" show syntax highlighting
syntax enable
" dark theme just like my heart
set background=dark
" show line numbers
set number
" re-enable backspace usage
set backspace=2
set backspace=indent,eol,start
" use 4 space charachters for indentation
tonygaetani /
Last active Apr 8, 2017
an example of concurrent.futures.ProcessPoolExecutor for python 2.7
import concurrent.futures
import time
def sleep_print_return(input):
print "{} started".format(input)
time.sleep(input % 3)
return input
def main():
# to observe the difference, change max_workers to 1
View build-each-commit.bash
#!/usr/bin/env bash
set -euo pipefail
HEAD=$(git rev-parse --abbrev-ref HEAD)
if [[ "${HEAD}" == "HEAD" ]]; then
HEAD=$(git rev-parse HEAD)
if [[ -n $(git status --porcelain) ]]; then
tonygaetani /
Created Jan 29, 2016
Vagrant/Linux increase swap memory
# Thank you to Jorge Quilcate Otoya for this helpful script
# size of swapfile in megabytes
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
tonygaetani /
Last active Jan 27, 2016
Potential argparse issue?
#!/usr/bin/env python
# mac OSX 10.10.3
# python 2.7.10 (installed with homebrew)
# argparse 1.4.0
# to test - `python --help`
# expected -
# usage: [-h] -f FOO [-b BAR]
View .basic.tmux.conf
# increased buffer size
set-option -g history-limit 5000
# shell
set-option -g default-shell /bin/$SHELL
# no delay for escape key press
set -sg escape-time 0
tonygaetani / Vagrantfile
Last active Aug 28, 2019 — forked from leifg/Vagrantfile
Add a second disk to system using vagrant
View Vagrantfile
config.vm.provider "virtualbox" do |v|
file_to_disk = './tmp/large_disk.vdi'
unless File.exist?(file_to_disk)
v.customize ['createhd', '--filename', file_to_disk, '--size', 500] # size is in MB
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
View binconv.clj
(defn pow2 [n]
"Returns a long representing 2^n"
(->> n (Math/pow 2) long))
(defn b10->b2
"Converts a base 10 number to a lazy seq of 1's and 0's that make up a base 2 number"
([n] (b10->b2 n '()))
([n col]
(if (= 1 n)
(merge col 1) ; base case
You can’t perform that action at this time.