Skip to content

Instantly share code, notes, and snippets.

View douglasmiranda's full-sized avatar
👽

Douglas Miranda douglasmiranda

👽
  • Earth, Brazil
View GitHub Profile
@douglasmiranda
douglasmiranda / # python - 2015-12-09_04-01-54.txt
Created December 9, 2015 18:47
python on OS X 10.11.1 - Homebrew build logs
Homebrew build logs for python on OS X 10.11.1
Build date: 2015-12-09 04:01:54
# Remove the Delay for Auto-Hide & Auto-Show of Dock in OS X
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock
# undo
defaults delete com.apple.Dock autohide-delay && killall Dock
@douglasmiranda
douglasmiranda / gist:ad5da92c580ae7a3ecc9
Created August 23, 2015 21:23
virtualbox - vboxmanage convert vmdk to vdi
vboxmanage clonehd disk1.vmdk disk1.vdi --format VDI --variant Standard
@douglasmiranda
douglasmiranda / gist:0fe8a8e8cd47efb8f463
Created August 22, 2015 00:15
Generate key id_rsa.ppk with putty
puttygen id_rsa -O private -o private.ppk
@douglasmiranda
douglasmiranda / gist:0a45e2048d095eea631c
Last active September 22, 2015 20:42
pdf to image (poppler)
apt-get install poppler-utils
pdftoppm -r 100 -png foo.pdf prefix
#!/bin/bash
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
douglasmiranda / gist:8b9595864ec06a7b8c27
Last active August 29, 2015 14:23
sublime preferences
{
"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",
"font_options":
[
@douglasmiranda
douglasmiranda / docker-compose.yml
Last active August 29, 2015 14:21
Docker - Data container for postgresql
dbdata:
image: <IMAGE>
volumes:
- /var/lib/postgresql
command: ['bash', '-c', 'echo "postgresql data container for db"; trap "exit 0" SIGTERM; while true; do sleep 5; done']
# strategy_best.py
# 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
douglasmiranda / gist:f4fb99eb25a59838489b
Created March 25, 2015 05:04
install thumbor (ubuntu 14.04)
add-apt-repository ppa:mc3man/trusty-media -y && sudo apt-get update
apt-get install ffmpeg libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl webp python-opencv python-dev python-pip
pip install thumbor