Skip to content

Instantly share code, notes, and snippets.

View hbillings's full-sized avatar

Heather Billings hbillings

View GitHub Profile
@hbillings
hbillings / how-to-git.md
Last active December 12, 2016 15:43
Basic git commands

#GitHub vs git

  • git (lowercase) is a version control system. There are many like it, but this one is ours. It is free and available for anyone to use. git is usually used from a command prompt.
  • GitHub is a company that allows you to save your code to their servers so that anyone can access it from anywhere. GitHub relies on git to manage the state of your code. GitHub has created an app that you can use to issue git commands, so you don't have to use the command line if you don't want.

This is a getting-started guide for the command line.

#Terminology

@hbillings
hbillings / gist:e68b6077b15b02e9fb6e
Created April 25, 2015 19:58
Read a CSV, spit out JSON for D3
import csv
import json
is_first_line = True
input_file_name = "your_file_here.csv"
output_file_name = "arrays.json"
output_json_obj = open(output_file_name, "wb")
items = {
"orange": "It's an orange hat day!",
"blue": "It's a blue hat day!",
"jersey": "Time to bust out the Cutler jersey!",
"otherwise": "Take a day off and wear something else."
}
def what_to_wear(day):
orange = False
blue = False
@hbillings
hbillings / gist:80b44fb4f686b19ca891
Last active August 29, 2015 14:01
Javascript refactor
function Article(){
stuff = arguments[1];
}
Article.prototype = {
// make this DRY-compatible
get_tags:function(path) {
tags = [];
for (word in stuff.split()) {
sometags = Tags.get_all(path);
@hbillings
hbillings / Inversions
Created March 26, 2012 02:58
Recursively find inversions, then merge and find split inversions
#!usr/bin/python
import csv
num_reader = csv.reader(open('some_file.txt','rb'), delimiter="\n")
nums = list(num_reader)
# testing list so we don't have to use a huge file
# nums = [6,8,3,5,1,2,9,7,4,12,10,11]
@hbillings
hbillings / graph.html
Created December 14, 2011 04:13
A lotta Flot: Getting started with simple JavaScript charts
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>A lotta Flot</title>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="jquery.flot.min.js"></script>
<script language="javascript" type="text/javascript" src="graph.js"></script>