Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
First,
hg clone http://bitbucket.org/durin42/hg-git HGGIT_PATH
Second, in "mercurial.ini" add:
[extensions]
hggit=HGGIT_PATH\hggit
# locale string from: http://msdn.microsoft.com/en-us/library/cdax410z(v=VS.80).aspx | |
if sys.platform in [ 'win32']: | |
locale.setlocale(locale.LC_ALL, 'fra') |
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html | |
# First of all you need to have a clean clone of the source repository so we didn't screw the things up. | |
git clone git://server.com/my-repo1.git | |
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command | |
git filter-branch --subdirectory-filter your_dir -- -- all | |
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command. |
def rows_as_dicts(cursor): | |
colnames = cursor.fields | |
for row in cursor: | |
yield dict(zip(colnames, row)) | |
with arcpy.da.SearchCursor(r'c:\data\world.gdb\world_cities', '*') as sc: | |
for row in rows_as_dicts(sc): | |
print row['CITY_NAME'] |
import collections | |
def rows_as_namedtuples(cursor): | |
col_tuple = collections.namedtuple('Row', cursor.fields) | |
for row in cursor: | |
yield col_tuple(*row) | |
with arcpy.da.SearchCursor(r'c:\data\world.gdb\world_cities', '*') as sc: | |
for row in rows_as_namedtuples(sc): | |
print sc.CITY_NAME |
""" | |
pip-install.py | |
A pure python script to download and install the distribute_setup and | |
pip utilities | |
Adapted from: | |
http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows/15294806#15294806 | |
http://stackoverflow.com/questions/2792650/python3-error-import-error-no-module-name-urllib | |
http://stackoverflow.com/questions/1093322/how-do-i-check-what-version-of-python-is-running-my-script |
import requests | |
import json | |
description = "published from Leo" # todo: derive from docstring, if present, otherwise 1st para | |
public = True | |
filename = p.h # node headline | |
content = p.b # node body | |
api_url = 'https://api.github.com/gists' |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Created by Leo (http://webpages.charter.net/edreamleo/front.html) --> | |
<?xml-stylesheet ekr_test?> | |
<leo_file xmlns:leo="http://www.leo-editor.org/2011/leo" > | |
<leo_header file_format="2"/> | |
<vnodes> | |
<v t="maphew.20130607222534.1739" a="E"><vh>@button Run Elevated</vh> | |
<v t="maphew.20130608014320.1983"><vh>docstring</vh></v> | |
<v t="maphew.20130608014320.1743"><vh>imports</vh></v> | |
<v t="maphew.20130608014320.1744"><vh>Leo preparation</vh></v> |