Skip to content

Instantly share code, notes, and snippets.


Douglas Soares de Andrade douglas

View GitHub Profile
douglas / weeks_count.rb
Created Jan 18, 2019 — forked from tlux/weeks_count.rb
Rails: Calculate the number of Calendar Weeks in a Year
View weeks_count.rb
def weeks_count(year)
last_day =
if last_day.cweek == 1
douglas / GitHub with Operator Mono font for
Created Aug 21, 2018 — forked from tdd/GitHub with Operator Mono font for
Use Operator Mono Ssm font in GitHub code views (PRs, diffs, etc.)
View GitHub with Operator Mono font for

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 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 / genesis_public_key
Last active Feb 28, 2018
View genesis_public_key
View gist:134f363b5c993b17ce7f13ccfcd98907
brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install
douglas / fix_virtualenv
Created Oct 2, 2015 — forked from tevino/fix_virtualenv
Fix python virtualenv after python update
View fix_virtualenv
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip2)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
echo "Ensure the root of current virtualenv:"
echo " $ENV_PATH"
read -p "‼️ Say no if you are not sure (y/N) " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "♻️ Removing old symbolic links......"
View gist:5ce4625801e4c72ad1d3
table <exclude_subnets> {,,}
table <allowed_subnets> {!,!,!}
table <include_subnets> {}
rdr pass on lo0 proto tcp to <include_subnets> -> 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
setup_brew () {
if ![-f "/usr/local/bin/brew"]; then
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL"
setup_ipython () {
brew install readline
View net.hecticjeff.firewall.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
douglas / default_python_project.sublime-project
Created Apr 24, 2013
SublimeJedi python example project file
View default_python_project.sublime-project
"follow_symlinks": true,
"path": "/Users/douglas/Work/code/uniceub/final/sgpa_project"
"settings": {
"python_interpreter_path": "/Users/douglas/Work/ambientes/sgpa/bin/python",
douglas / robot.js
Created Dec 1, 2012 — forked from heynemann/robot.js
Merry Go round
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
this.offset = 1;
Robot.prototype.onIdle = function(ev) {