Skip to content

Instantly share code, notes, and snippets.

View ariamoraine's full-sized avatar

Aria ariamoraine

View GitHub Profile
require.paths.unshift(__dirname + "/vendor");
var http = require('http'),
sys = require('sys'),
nodeStatic = require('node-static/lib/node-static');
var server = http.createServer(function(request, response) {
var file = new nodeStatic.Server('./public', {
cache: false
});
var http = require('http'),
sys = require('sys'),
nodeStatic = require('node-static');
faye = require('faye'),
url = require('url');
function LiveStats(options) {
if (! (this instanceof arguments.callee)) {
return new arguments.callee(arguments);
var nodeio = require('node.io');
var methods = {
input: false,
run: function() {
exports.job = new nodeio.Job({timeout:10}, methods);
this.getHtml('http://www.google.com/', function(err, $, data, headers) {
$('a').each('href', function (href) {
//Print all links on the page
var express = require('express');
var app = express();
var nodeio = require('node.io');
var scraper = {
input: false,
run: function() {
this.getHtml('http://www.simplesteps.org/eat-local/state/new-york', function(err, $) {
//Handle any request / parsing errors
@ariamoraine
ariamoraine / knitting.py
Created October 9, 2012 22:39
knitting
"""
Author: Corey Lynch
Date: 10/4/12
example: python knitting.py 4 test.jpg 300 200
"""
import numpy as np
import pylab as pl
from sklearn.cluster import KMeans

Prompt

Given a current time in the string format HH:MM and a number of minutes, return the clock time given those minutes added to the base time. Assume you're working with a standard 12-hour clock and the output should match the input format HH:MM.

Examples

addMinutes('1:30', 30);     // 2:00
addMinutes('12:30', 40);    // 1:10
addMinutes('11:59', 1); // 12:00