Skip to content

Instantly share code, notes, and snippets.

View douglas's full-sized avatar

Douglas Soares de Andrade douglas

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.hecticjeff.firewall</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
@douglas
douglas / default_python_project.sublime-project
Created April 24, 2013 19:38
SublimeJedi python example project file
{
"folders":
[
{
"follow_symlinks": true,
"path": "/Users/douglas/Work/code/uniceub/final/sgpa_project"
}
],
"settings": {
"python_interpreter_path": "/Users/douglas/Work/ambientes/sgpa/bin/python",
@douglas
douglas / robot.js
Created December 1, 2012 14:06 — forked from heynemann/robot.js
Merry Go round
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
robot.turn(45);
this.offset = 1;
};
Robot.prototype.onIdle = function(ev) {
@douglas
douglas / robot.js
Created December 1, 2012 14:05 — forked from brunoborges/robot.js
rob3
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@douglas
douglas / trim_enabler.sh
Created November 16, 2012 20:11 — forked from return1/trim_enabler.txt
TRIM Enabler for OS X Mountain Lion 10.8.2 or higher
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
sudo touch /System/Library/Extensions/
# now reboot!
@douglas
douglas / validators.py
Created June 25, 2012 03:49 — forked from dokterbob/validators.py
Validator for files, checking the size, extension and mimetype.
from os.path import splitext
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import filesizeformat
class FileValidator(object):
"""
Validator for files, checking the size, extension and mimetype.
@douglas
douglas / gist:2694967
Created May 14, 2012 16:36
Force a git repo to point to a new HEAD
git push origin HEAD --force
@douglas
douglas / solarized.css
Created April 12, 2012 16:23 — forked from scotu/solarized.css
Solarized Light Pygments CSS
.highlight { background-color: #ffffcc }
.highlight .c { color: #586E75 } /* Comment */
.highlight .err { color: #93A1A1 } /* Error */
.highlight .g { color: #93A1A1 } /* Generic */
.highlight .k { color: #859900 } /* Keyword */
.highlight .l { color: #93A1A1 } /* Literal */
.highlight .n { color: #93A1A1 } /* Name */
.highlight .o { color: #859900 } /* Operator */
.highlight .x { color: #CB4B16 } /* Other */
.highlight .p { color: #93A1A1 } /* Punctuation */
@douglas
douglas / hack.sh
Created April 2, 2012 16:53 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@douglas
douglas / fix_virtualenv
Created October 2, 2015 17:19 — forked from tevino/fix_virtualenv
Fix python virtualenv after python update
#!/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
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "♻️ Removing old symbolic links......"