Skip to content

Instantly share code, notes, and snippets.

View patrickdevivo's full-sized avatar

Patrick DeVivo patrickdevivo

View GitHub Profile
@patrickdevivo
patrickdevivo / 0_reuse_code.js
Created October 18, 2013 01:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@patrickdevivo
patrickdevivo / fib.asm
Created November 3, 2012 22:37
Fibonacci sequencer in assembly
;;; Fibonacci Sequence
SA 0x80
COPY %rA
SA 0x00
COPY %rB
STOR %rB %rA ; set F(0)=0
SA 0x81
COPY %rA
@patrickdevivo
patrickdevivo / sum-array.asm
Created November 3, 2012 20:37
Sum an array
;;; Sum an array
;; Load 0 (where iterator initializes) into %rB
SA 0x01
COPY %rB
;; Load n (length of array, also number of iterations when summing the array) into %rA
cond: LLAC n
COPY %rD ; %rD = &n
LOAD %rA %rD ; %rA = n
csv = require 'csv'
_ = require 'underscore'
Table = require 'cli-table'
class Class
constructor: (@code, @sect, @title, @teacher, @room, @capacity, @grade) ->
classes = {}
schedule = {
M: [[], [], [], [], [], [], [], []] # DAY: period[classess[]]
@patrickdevivo
patrickdevivo / palindrome.coffee
Created May 10, 2012 23:44
CoffeeScript palindrome...
palindrome = (string) -> if string.toUppercase() == string.toUppercase().split('').reverse().join('') then return true else return false
@patrickdevivo
patrickdevivo / fbNotifications.ino
Created January 15, 2012 05:03
Turns an LED on whenever I receive a Facebook notification
const int ledPin = 9; // the pin that the LED is attached to
void setup()
{
// initialize the serial communication:
Serial.begin(9600);
// initialize the ledPin as an output:
pinMode(ledPin, OUTPUT);
}
@patrickdevivo
patrickdevivo / fib_blink.ino
Created January 13, 2012 01:58
Blink LED on Arduino UNO with fibonacci delay
@patrickdevivo
patrickdevivo / twitter.rb
Created January 4, 2012 22:41
Update twitter status
require 'twitter'
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
end
if ARGV[0] == '-t' and ARGV[1] # if -t flag and tweet exist
var https = require('https');
var url = require('url');
var util = require('util');
var exec = require('child_process').exec;
var fb_user_id =;
var fb_access_token = '';
var path = '/' + fb_user_id + '/notifications/' + '?access_token=' + fb_access_token;
var options = {
/*
* jQuery Color Animations
* Copyright 2007 John Resig
* Released under the MIT and GPL licenses.
*/
(function(jQuery){
// We override the animation for all of these color styles
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){