git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
import sublime, sublime_plugin | |
import os.path, string | |
VALID_FILENAME_CHARS = "-_.() %s%s%s" % (string.ascii_letters, string.digits, "/:\\") | |
# { "keys": ["alt+o"], "command": "open_filename_under_cursor" } | |
# https://gist.github.com/1186126 | |
class OpenFilenameUnderCursor(sublime_plugin.TextCommand): | |
def run(self, edit): | |
for region in self.view.sel(): |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
This playbook has been removed as it is now very outdated. |
""" | |
example: The following JSON document: | |
{"maps":[{"id1":"blabla","iscategorical1":"0", "perro":[{"dog1": "1", "dog2": "2"}]},{"id2":"blabla","iscategorical2":"0"}], | |
"masks":{"id":"valore"}, | |
"om_points":"value", | |
"parameters":{"id":"valore"}} | |
will have the following output: | |
{'masks.id': 'valore', 'maps.iscategorical2': '0', 'om_points': 'value', 'maps.iscategorical1': '0', | |
'maps.id1': 'blabla', 'parameters.id': 'valore', 'maps.perro.dog2': '2', 'maps.perro.dog1': '1', 'maps.id2': 'blabla'} |
import sys | |
from time import sleep | |
import smtplib | |
import getpass | |
from fabric.api import env, prompt, local | |
gmail_pw = getpass.getpass("enter your gmail password: ") | |
ps_id = prompt("enter process_id: ") | |
mysql_user = env.user |
''' | |
texture image path are relative to the blend file directory. run from command line like this: | |
texture=img/2012720989_c.jpg blender -b mug.blend --python texture_change.py -F PNG -s 1 -e 1 -j 1 -t 0 -a | |
'''' | |
import os | |
image_file = os.getenv('texture') | |
if not image_file: | |
image_file="img/2012720989_c.jpg" |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
var aws_router = require('./routes/aws'); | |
app.use('/aws', aws_router); | |
//npm install aws-sdk | |
//visit http://localhost:3000/aws/table-list |