Skip to content

Instantly share code, notes, and snippets.

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
control_pins = [7,11,13,15]
for pin in control_pins:
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, 0)
halfstep_seq = [
[1,0,0,0],
[1,1,0,0],
@edhedges
edhedges / randomRedditImage.js
Created July 23, 2012 20:16
This is a little script I started to inject a random /r/aww image into my 404 page.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>edTest</title>
</head>
<body>
<img id="random_image" alt="random aww image" />
</body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
@edhedges
edhedges / gist:2995805
Created June 26, 2012 13:30
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@edhedges
edhedges / clients.md
Created May 11, 2012 03:59 — forked from defunkt/clients.md
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@edhedges
edhedges / .bashrc
Created February 11, 2012 21:14
My .bashrc
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
export WORKON_HOME=$HOME/virtualenvs
export PROJECT_HOME=$HOME/projects
source /usr/local/bin/virtualenvwrapper.sh
mkdjangoproj () {
@edhedges
edhedges / Program.cs
Created November 29, 2011 18:22
Simple team randomizer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Teams
{
class Program
{
static void Main(string[] args)
@edhedges
edhedges / fraction.h
Created November 29, 2011 14:44
Fraction Computation Header file
/**********************************************
* fraction.h: this header file has the private
fields used in fraction.cpp and also has the
prototypes for the functions in fraction.cpp. *
***********************************************/
#ifndef FRACTION_H
#define FRACTION_H
/**********************************************
* class Fraction: this class allows us to make
@edhedges
edhedges / fraction.cpp
Created November 29, 2011 14:42
Fraction Computation file
/**********************************************
* fraction.cpp: this handles all of the actual
computations done to the fractions. *
***********************************************/
#include <iostream>
using namespace std;
#include "fraction.h"
/**********************************************
* setValues function: this function is pretty
@edhedges
edhedges / main.cpp
Created November 29, 2011 14:41
Fraction Calculator Main code
/**********************************************
* Name: Eduardo Hernandez-Hedges *
* Date: 10/20/2010 *
* Assignment: Project 5: Fractions *
***********************************************
* This project asks the user for two fractions
then asks the user whether they want to add,
subtract, multiply, or divide them. Then it
prints out the correct reduced value *
***********************************************/
@edhedges
edhedges / User.cs
Created November 29, 2011 14:30
User class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HedgesBlackjack
{
class User : Player
{
private int _numWins = 0;