This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
* Off the top of my head * | |
1. Fork their repo on Github | |
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
git remote add my-fork [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run the script you must set PYTHONPATH and path to QGIS binaries | |
# | |
# on Linux: export PYTHONPATH=/qgispath/share/qgis/python | |
# on Windows: set PYTHONPATH=c:\qgispath\python | |
# on OSX: export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python | |
# export PATH="/Applications/QGIS.app/Contents/MacOS/bin:$PATH" | |
from qgis.core import * | |
import sys | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a port of Ken Perlin's "Improved Noise" | |
// http://mrl.nyu.edu/~perlin/noise/ | |
// Originally from http://therandomuniverse.blogspot.com/2007/01/perlin-noise-your-new-best-friend.html | |
// but the site appears to be down, so here is a mirror of it | |
class Perlin { | |
var $p, $permutation, $seed; | |
var $_default_size = 64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gdata | |
import json | |
import requests | |
# More examples: | |
# https://github.com/millioner/Python-contact-importer/blob/master/contact_importer/providers/google.py | |
# https://github.com/jtauber/django-friends/blob/master/friends/importer.py | |
# GData with access token | |
token = gdata.gauth.OAuth2Token( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import sys | |
import jinja2 | |
import markdown | |
TEMPLATE = """<!DOCTYPE html> | |
<html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
*/ | |
SET NAMES utf8; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS postcodes_geo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hosts/domain names that are valid for this site; required if DEBUG is False | |
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts | |
ALLOWED_HOSTS = [ | |
'yourdomain.tld', | |
'.compute-1.amazonaws.com', # allows viewing of instances directly | |
] | |
import requests | |
EC2_PRIVATE_IP = None | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from json import load, JSONEncoder | |
from argparse import ArgumentParser, FileType | |
from re import compile | |
import sys | |
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$') | |
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example code for connecting to Stardog (http://stardog.com/) with | |
Python's RDFLib (http://github.com/rdflib). | |
See longer description: http://lawlesst.github.io/notebook/rdflib-stardog.html | |
""" | |
OlderNewer