Skip to content

Instantly share code, notes, and snippets.

Avatar

JaZahn Clevenger jazahn

  • Harvard University
View GitHub Profile
View holdouts.json
[
{
"name": "The Greenbrier Resort",
"lat": "37.786699",
"lng": "-80.304993"
},
{
"name": "Mount Weather",
"lat": "39.0624489",
"lng": "-77.8883457"
View .jshintrc
{
// 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
View Calc.js
define([], function(){
var Calc = function(){
};
Calc.prototype.multiply = function(a, b){
return a * b;
};
return Calc;
View ModuleName.js
var ModuleName = (function(){
var methodName = function(){
// do something...
};
var anotherMethodName = function(){
// do something else...
};
return {
methodName: methodName,
@jazahn
jazahn / gist:1429a1072c04b51f9406
Created Jun 15, 2015
sample of ims-lti for node
View gist:1429a1072c04b51f9406
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,
View gist:aca49f3e3f9a5b819bce
# Dockerfile to build Python WSGI Application Containers
# Based on Ubuntu
############################################################
# Set the base image to Ubuntu
FROM ubuntu
# File Author / Maintainer
MAINTAINER Maintaner Name
View gist:2821faf2fd5576558695
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],
View gist:9b725b0cd71a6fb0e435
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 Apr 5, 2012
getLastInsertId workaround for Oracle
View myActiveRecord
<?php
class QActiveRecord extends CActiveRecord {
public function afterSave(){
if(Yii::app()->db->driverName == 'oci'){
try {
@jazahn
jazahn / Autoincrement.php
Created Apr 4, 2012
Autoincrememnt Yii Migration helper
View Autoincrement.php
<?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;