Skip to content

Instantly share code, notes, and snippets.

View jazahn's full-sized avatar

JaZahn Clevenger jazahn

  • Harvard University
View GitHub Profile
@jazahn
jazahn / holdouts.json
Last active September 27, 2015 06:37
[
{
"name": "The Greenbrier Resort",
"lat": "37.786699",
"lng": "-80.304993"
},
{
"name": "Mount Weather",
"lat": "39.0624489",
"lng": "-77.8883457"
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@jazahn
jazahn / Calc.js
Last active September 9, 2015 20:07
define([], function(){
var Calc = function(){
};
Calc.prototype.multiply = function(a, b){
return a * b;
};
return Calc;
@jazahn
jazahn / ModuleName.js
Created September 2, 2015 15:47
Module Pattern
var ModuleName = (function(){
var methodName = function(){
// do something...
};
var anotherMethodName = function(){
// do something else...
};
return {
methodName: methodName,
@jazahn
jazahn / gist:1429a1072c04b51f9406
Created June 15, 2015 16:14
sample of ims-lti for node
var https = require('https');
var fs = require('fs');
var express = require('express');
var app = express();
var lti = require('ims-lti');
var ssl_options = {
key: fs.readFileSync(__dirname + '/ssl/localhost.key'),
cert: fs.readFileSync(__dirname + '/ssl/localhost.crt'),
requestCert: false,
# Dockerfile to build Python WSGI Application Containers
# Based on Ubuntu
############################################################
# Set the base image to Ubuntu
FROM ubuntu
# File Author / Maintainer
MAINTAINER Maintaner Name
@jazahn
jazahn / gist:2821faf2fd5576558695
Created May 2, 2014 16:18
iTunesU data collection
var http = require("http");
var https = require("https");
var parseString = require('xml2js').parseString;
var Metadata = require('fluent-ffmpeg').Metadata;
var fs = require("fs");
var stream = fs.createWriteStream("itunesu.csv");
var jsdom = require("jsdom");
var channels = {courses: [819616149, 512201207, 571347835, 566636297, 786312091, 624655973, 613647256, 502492375,
529181544, 670536578, 670536610, 670535516, 625966490, 670536607, 670535213, 670662986, 625902714],
@jazahn
jazahn / gist:9b725b0cd71a6fb0e435
Created May 2, 2014 16:06
youtube data collection
var https = require("https");
var fs = require("fs");
var stream = fs.createWriteStream("youtube.csv");
var nameArray = ["Harvard", "HarvardBSchool", "HarvardKennedySchool", "HarvardEducation", "HarvardLawSchool", "HarvardMedicalSchool", "HarvardPublicHealth", "TheHarvardGSD", "HarvardDivinity", "BerkmanCenter", "AshInstitute", "HarvardBusiness", "Harvardilab", "HarvardExtension", "HarvardCPL", "ArnoldArboretum", "GreenIsTheNewCrimson", "BelferCenter"];
var start = 1;
var url = function(name, start){
return "https://gdata.youtube.com/feeds/api/users/"+name+"/uploads?alt=json&start-index="+start+"&max-results=50&caption=false";
}
var output = '';
@jazahn
jazahn / myActiveRecord
Created April 5, 2012 17:56
getLastInsertId workaround for Oracle
<?php
class QActiveRecord extends CActiveRecord {
public function afterSave(){
if(Yii::app()->db->driverName == 'oci'){
try {
@jazahn
jazahn / Autoincrement.php
Created April 4, 2012 19:56
Autoincrememnt Yii Migration helper
<?php
class Autoincrement {
function up($table_name, $driver){
if($driver == 'mysql') {
$createAutoincrement = <<< SQL
ALTER TABLE $table_name MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT
SQL;