Skip to content

Instantly share code, notes, and snippets.

View douglas's full-sized avatar

Douglas Soares de Andrade douglas

View GitHub Profile
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@douglas
douglas / GitHub with Operator Mono font for code.md
Created August 21, 2018 13:14 — forked from tdd/GitHub with Operator Mono font for code.md
Use Operator Mono Ssm font in GitHub code views (PRs, diffs, etc.)

So you love the Operator Mono font? I don't blame you! So do we! It's a bit pricey but worth every penny.

In fact, we're so used to it in our editors that we were a bit sad with GitHub's otherwise neat code views. When we review PRs in the web UI, we want our Operator Mono!

So, assuming you have it installed on your machine, you can put the JS bit in the other code snippet of this Gist in a bookmarklet, and click it when you're on a GitHub.com page you want to have switch over to our beloved font. We used the ScreenSmart variant here, which you get in the font package and have probably installed, as it's the more legible one on screens. Feel free to adjust the font name if needed.

@douglas
douglas / selenium_with_python.rst
Created July 22, 2011 23:24 — forked from baijum/selenium_with_python.rst
Selenium with Python

Selenium with Python

Author

Baiju Muthukadan

Email

baiju.m.mail AT gmail.com

Version

0.3.2

Note

@douglas
douglas / gist:1066406
Created July 6, 2011 02:27
Install swig on a ubuntu box
sudo apt-get install swig
@douglas
douglas / gist:5ce4625801e4c72ad1d3
Created June 18, 2015 19:37
PF rules sshuttle
table <exclude_subnets> {200.152.40.0/24,127.0.0.0/8,10.0.0.0/8}
table <allowed_subnets> {!200.152.40.0/24,!127.0.0.0/8,!10.0.0.0/8}
table <include_subnets> { 0.0.0.0/0}
rdr pass on lo0 proto tcp to <include_subnets> -> 127.0.0.1 port 12300
pass out route-to lo0 inet proto tcp to <include_subnets> keep state
pass out route-to lo0 inet proto tcp to <exclude_subnets> keep state
@douglas
douglas / weeks_count.rb
Created January 18, 2019 16:43 — forked from tlux/weeks_count.rb
Rails: Calculate the number of Calendar Weeks in a Year
def weeks_count(year)
last_day = Date.new(year).end_of_year
if last_day.cweek == 1
last_day.prev_week.cweek
else
last_day.cweek
end
end
@douglas
douglas / genesis_public_key
Last active February 28, 2018 15:20
genesis_public_key
04be271724b3df3dd641cbb13ae5b15b277bb87fb2de0f16050161ee5e43c3795b4161449b486028aa4db776556d0f30d2baf83dca7f13fb353ea745c268d13dd4;fnando
@douglas
douglas / install_swig_mac.sh
Created July 6, 2011 01:47
Install swig on a mac with homebrew
brew install https://raw.github.com/cobrateam/formulae/master/swig.rb
@douglas
douglas / gist:134f363b5c993b17ce7f13ccfcd98907
Created September 23, 2016 13:38
Install Nokogiri using bundle
brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install
#!/bin/sh
setup_brew () {
if ![-f "/usr/local/bin/brew"]; then
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
fi
}
setup_ipython () {
brew install readline