Skip to content

Instantly share code, notes, and snippets.

View clhenrick's full-sized avatar

Chris Henrick clhenrick

View GitHub Profile
@clhenrick
clhenrick / gist:4410384
Created December 30, 2012 01:22
a Scriptographer script that will select all text items that match the same character style (typeface, point size, color.) of an already selected text item.
//select text that has the same font and font fill color as the current text selection.
//Point size, tracking, and leading may vary and should not be considered parameters.
//tell illustrator to use the selected text item to copy the characterStyle.font and
//characterStyle.fillColor properties from.
var matchThis = document.getItems({
type: 'TextItem',
selected: true,
});
@clhenrick
clhenrick / updateCharStyle.js
Created December 30, 2012 02:52
a scriptographer script that will take a selected text object's layer and apply character styles to all other text objects on that layer.
/******************
update character styles from FreeHand for Moon template character styles
select all type on an active layer and apply character syle properties to match the template
TO DO: 1. figure out the easy way of doing this by referencing actual Character Styles from the templates character styles' panel
note: scriptographer does not have an object array for defined character styles in the document. bummer!
instead, create variables for each character style and assign them that way?
2. make script cycle through all layers in the document and auto assign character styles to correct layers.
*******************/
var layer = document.activeLayer;
@clhenrick
clhenrick / python_cheat_sheet.py
Last active April 18, 2022 00:41
cheat sheet to help me learn python
"""
Python Command and Character list From Learn Python the Hardway by Zed Shaw (expanded from Lesson 22)
"""
### Character / Command What it's called What it does example example2 ###
pydoc <something> #pydoc gives you the manual page for something you want to know about in python pydoc sys
help() #help function use when running python to find help on an object
print() #print function prints to the console whatever is next print(“Hello World!”) print(1 + 2)
" " # double quotes starts and ends a string print(“Hello World!”)
' ' # single quotes starts and ends a string print('Hello World!')
@clhenrick
clhenrick / DTD_exercise_3.xml
Last active December 11, 2015 14:48
XML DTD exercise 3 for Stanford's intro to databases class
<!--DTD exercise 3 for Stanford's Intro to Databases
https://prod-c2g.s3.amazonaws.com/db/Winter2013/files/courses-ID.xml-->
<!ELEMENT Course_Catalog (Department*)>
<!ELEMENT Department (Title, Course+, (Professor | Lecturer)*)>
<!ATTLIST Department Code CDATA #REQUIRED Chair CDATA #REQUIRED>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Course (Title, Description?)>
<!ATTLIST Course Number CDATA #REQUIRED Prerequisites CDATA #IMPLIED Instructors CDATA #REQUIRED Enrollment CDATA #IMPLIED>
<!ELEMENT Professor (First_Name, Middle_Initial?, Last_Name)>
<!ATTLIST Professor InstrID CDATA #REQUIRED>
@clhenrick
clhenrick / geojsonCircleMarker
Created October 23, 2013 01:42
leaflet geojson circleMarkers
// create a variable to load Stamen 'toner' tiles
var layer = new L.StamenTileLayer("toner");
// initialize and set map center and zoom
var map = L.map('map', {
center: new L.LatLng(40.67, -73.94),
zoom: 11
});
// create the map
@clhenrick
clhenrick / geojsonCircleMarkerHTML
Last active December 26, 2015 06:49
geojsonCircleMarkerHTML
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.min.css">
@clhenrick
clhenrick / extract_weekly_dates_from_geojson.py
Last active January 2, 2016 07:58
Demo showing that Python is effective at processing GeoJson data, as the format is similar to Python's dictionary object type.
#! usr/bin/env/python
# loop through input data and add one feature per week to output data
# create a while loop with a counter that adds 7 days from start day and
# maxes out at an end date
from sys import argv
import simplejson as json
from datetime import datetime, timedelta
@clhenrick
clhenrick / index.html
Last active December 21, 2015 08:27
Leaflet AnimatedMarker plug-in test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://rawgithub.com/clhenrick/Major-Studio-Two/gh-pages/map-story/html/js/pct-trail-partial.js"></script>
<script src="http://rawgithub.com/openplans/Leaflet.AnimatedMarker/master/src/AnimatedMarker.js"></script>
@clhenrick
clhenrick / index.html
Last active August 29, 2015 13:57
Triggering openPopup() with an AnimatedMarker in Leaflet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://rawgithub.com/openplans/Leaflet.AnimatedMarker/master/src/AnimatedMarker.js"></script>
<script src="http://rawgithub.com/makinacorpus/Leaflet.GeometryUtil/master/dist/leaflet.geometryutil.js"></script>

Git Flow

I keep meeting people who struggle to wrap their heads around the proper way to use Git + Github. This snippet is designed to explain Vincent Driessen's git branching model, at least as well as I understand it. Speacial thanks to Stephen Koch for being the true master here.

This tutorial is for Linux or OSX. Feel free to use Cygwin or write a fork for windows.

A way to think about Git and Github.