Skip to content

Instantly share code, notes, and snippets.

Writing code from another galaxy.

Douglas Miranda douglasmiranda

Writing code from another galaxy.
View GitHub Profile
View gist:2b306fcba0f4678f920e
# Remove the Delay for Auto-Hide & Auto-Show of Dock in OS X
defaults write autohide-delay -float 0 && killall Dock
# undo
defaults delete autohide-delay && killall Dock
View gist:fb18400cfdbaeaf78c35
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# ubuntu 64bits issue
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
View gist:fb4a00be75fc0a68e79e
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<script type="text/javascript" src=""></script>
{{ }}
<form action="" method="post">
# Strategy pattern -- function-based implementation
# selecting best promotion from static list of functions
>>> joe = Customer('John Doe', 0)
>>> ann = Customer('Ann Smith', 1100)
>>> cart = [LineItem('banana', 4, .5),
... LineItem('apple', 10, 1.5),
... LineItem('watermellon', 5, 5.0)]
douglasmiranda / docker-compose.yml
Last active Aug 29, 2015
Docker - Data container for postgresql
View docker-compose.yml
image: <IMAGE>
- /var/lib/postgresql
command: ['bash', '-c', 'echo "postgresql data container for db"; trap "exit 0" SIGTERM; while true; do sleep 5; done']
View gist:8b9595864ec06a7b8c27
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Material-Theme (SL).tmTheme",
"draw_minimap_border": true,
"draw_white_space": "all",
"find_selected_text": true,
"font_face": "Fira Code",
datenow=$(date +%s)
sudo docker ps > /tmp/docker."$datenow"
sudo apt-get update && sudo apt-get install -y lxc-docker
sudo docker start $(tail -n +2 /tmp/docker."$datenow" | cut -c1-12)
douglasmiranda / gist:0fe8a8e8cd47efb8f463
Created Aug 22, 2015
Generate key id_rsa.ppk with putty
View gist:0fe8a8e8cd47efb8f463
puttygen id_rsa -O private -o private.ppk
View gist:0a45e2048d095eea631c
apt-get install poppler-utils
pdftoppm -r 100 -png foo.pdf prefix
douglasmiranda / last_tweet.js
Created Jun 23, 2011
Get the last tweet. (Requires the Jquery library)
View last_tweet.js
$.getJSON("", function(data) {
You can’t perform that action at this time.