In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
import hashlib | |
import hmac | |
import mimetypes | |
import binascii | |
from calendar import timegm | |
from datetime import datetime | |
import time | |
from email.utils import formatdate | |
from urllib.parse import quote, urlparse |
# !/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = 'Diego Garcia' | |
import tornado.web | |
import tornado.ioloop | |
import oauth2.tokengenerator | |
import oauth2.grant | |
import oauth2.store.redisdb | |
import oauth2.store.mongodb |
@app.route('/login/<provider_name>', methods=['GET', 'POST']) | |
@authomatic.login('g') | |
@requires_ssl | |
def login(provider_name): | |
if g.user is not None and g.user.is_authenticated(): | |
return redirect(url_for('index')) | |
if authomatic.result: | |
if authomatic.result.error: | |
return 'Something went wrong: {0}'.format(authomatic.result.error.message) | |
if authomatic.result.user: |
sudo apt-get update | |
sudo apt-get install -y openjdk-7-jdk | |
sudo su -c 'echo "JAVA_HOME=\"/usr/lib/jvm/java-7-openjdk-amd64\"" >> /etc/environment' | |
cd /opt | |
sudo wget http://d3kbcqa49mib13.cloudfront.net/spark-1.0.1-bin-hadoop2.tgz | |
sudo tar -zxf spark-1.0.1-bin-hadoop2.tgz | |
cd spark-1.0.1-bin-hadoop2 | |
# assumes that hostname is set correctly, and the main interface is on eth0, add HOSTNAME to /etc/hosts | |
sudo su -c "echo `ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'` `cat /etc/hostname` >> /etc/hosts" | |
sbin/start-master.sh |
For some reason, this didn't work with the standard GUI bluetooth tools, so I did the following
""" | |
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'} |
=begin
Example box JSON schema
{
:name => :name_of_vagrant_box, #REQUIRED
:ip => '10.0.0.11', #REQUIRED
:synced_folders => [
{ '.' => '/home/vagrant/myapp' }
],
:commands => [
from luigi.format import Format | |
import csvkit | |
class CSVOutputProcessor(object): | |
""" | |
A simple CSV output processor to be hooked into Format's | |
`pipe_writer`. | |
If `cols` are given, the names are used as CSV header, otherwise no | |
explicit header is written. |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: