Skip to content

Instantly share code, notes, and snippets.

View adammendoza's full-sized avatar

Adam J. Mendoza adammendoza

  • San Francisco, Calif.
View GitHub Profile
@adammendoza
adammendoza / gist:3606765
Created September 3, 2012 04:41 — forked from rmurphey/gist:846908
examples of testing with jasmine
function multiply(a, b) {
return a * b;
}
function divide(a, b) {
if (b === 0) {
throw "Don't try to divide by zero!";
}
return Math.round(a / b);
using System;
using System.Collections.Generic;
using System.Linq;
using YourMvcApp.Core.Bundlers;
using Microsoft.Web.Optimization;
namespace YourMvcApp.Core.Resources
{
public class BundleRegistration
{
#!/usr/bin/python
import subprocess
import re
import os
import sys
import optparse
import time
def call_checked(*args):
r = subprocess.call(args)
{
"name": "streamingtest",
"version": "0.0.1",
"engines": {
"node": ">=0.6.0"
},
"dependencies": {
"express": "2.5.x",
"coffee-script": "1.2.x"
},
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
<html>
<body>
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
</body>
</html>