Skip to content

Instantly share code, notes, and snippets.

View brunogama's full-sized avatar
🏠
Working from home

Bruno Gama brunogama

🏠
Working from home
  • Banco Inter
  • Brazil
  • 17:56 (UTC -03:00)
  • X @brunogama
View GitHub Profile
@brunogama
brunogama / gist:3040281
Created July 3, 2012 15:02
Make a account install 'til the end, setup your files and give me more space! :)
Always have your stuff when you need it with @Dropbox.
Sign up for free! http://db.tt/dV2cVTg
@brunogama
brunogama / homepath.py
Created July 5, 2012 21:17
Get home path and the current user
##### get home path
##### src: http://h3manth.com/content/getting-home-path-and-username-python
import os
home = os.curdir
if 'HOME' in os.environ:
home = os.environ['HOME']
elif os.name == 'posix':
home = os.path.expanduser("~/")
@brunogama
brunogama / gist:3104869
Created July 13, 2012 13:23
postmkvirtualenv install yolk and add the current dir to the postactivate hook
#!/bin/bash
# This hook is run after a new virtualenv is activated.
pip install yolk
echo "cd "$(pwd) >> $VIRTUAL_ENV/bin/postactivate
@brunogama
brunogama / AutoSaveAssets.cs
Created July 31, 2012 23:09 — forked from darktable/AutoSaveAssets.cs
Unity3D: Somewhat Hacky Method for Auto Saving Assets in Unity.
//#define VERBOSE
/* ***************************************************************************
Copyright 2011 Calvin Rien
(http://the.darktable.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@brunogama
brunogama / Xcode.py
Created October 22, 2012 03:16
little script to add stuff into the project.pbxproj (A file inside all *.xcodeproj package files)
#!/usr/bin/env python -tt
# -*- encoding: utf-8 -*-
# Xcode.py
# @author: Bruno Gama
# @email: bgamap at gmail.com
# @license: ICS
import subprocess
import shlex
import plistlib
@brunogama
brunogama / gist:4098889
Created November 17, 2012 19:01
this is helper function to open sublime text in the current directory. if there is a sublime-project file it will choose to open that file instead of doing subl ./
ss() {
__project=$(find . -iname "*.sublime-project" -d 1)
if [ -n "$__project" ]; then
echo "Opening ${__project}"
open $__project
else
echo "s $(dirname $0)"
subl $(dirname $0)
fi
unset __project
@brunogama
brunogama / gist:4659036
Created January 28, 2013 21:10
http://www.g8production.com/post/41358908279/how-to-get-the-class-of-a-property-with-objective-c HOW TO GET THE CLASS OF A PROPERTY WITH OBJECTIVE-C RUNTIME REFERENCE
//# How to get the Class of a Property of a Objective-C Class with Objective-C Runtime Reference.
+ (id)getPropertyClass:(objc_property_t)currentProperty
{
NSString *currentPropertyAttrs = [NSString stringWithUTF8String:property_getAttributes(currentProperty)];
NSError *error = nil;
wifi="en1"
lan="en0"
localnet="{ en0 en1 }"
set limit { frags 5000, states 2500 }
set block-policy drop
set skip on lo0
set fingerprints '/etc/pf.os'
set ruleset-optimization basic
set optimization normal
set loginterface pflog0
#!/usr/bin/env bash
# Written by William Ting for the following blog post:
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/
rcfile="${HOME}/.bashrc"
version="2.7.3"
setuptools_version="2.7"
tmp_dir="${HOME}/tmp-${RANDOM}"
if [[ ${#} == 0 ]]; then
@brunogama
brunogama / gist:5174906
Created March 16, 2013 03:59
Wipe Pip Packages
pip freeze | xargs pip uninstall -y