This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require("express"); | |
var app = express(); | |
app.use(express.static(__dirname + "/")); | |
//app.get("/", function(req, res) { | |
// res.send('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# init.sh | |
# shellscript to automate creating new projects | |
# initialize a git repo in current folder | |
# git init | |
# install express | |
# npm install --save express |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="x-ua-compatible" content="IE=edge" > | |
<head> | |
<title>Title</title> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
<link rel="stylesheet" href="lib/w3.min.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(js-load "https://cdnjs.cloudflare.com/ajax/libs/localforage/1.4.3/localforage.min.js" "window") | |
; the callback argument is passed two | |
; arguments, errors, and the value of | |
; the resulting function | |
; i.e. (lambda (err val) body), unless | |
; otherwise stated | |
; creates a new entry in the store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# init.sh | |
# shellscript to automate creating new projects | |
# initialize a git repo in current folder | |
git init | |
# initialize main folders | |
mkdir 'lib' 'src' | |
# create main files | |
touch 'src/index.coffee' 'src/views.coffee' 'src/templates.coffee' 'src/model.coffee' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="x-ua-compatible" content="IE=edge" > | |
<head> | |
<title>Title</title> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
<link rel="stylesheet" href="lib/w3.min.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{exec} = require 'child_process' | |
task 'bake-dev', 'Build project from src/*.coffee to lib/*.js', -> | |
exec 'cat src/* | coffee --compile --stdio > lib/bundle.js', (err, stdout, stderr) -> | |
throw err if err | |
console.log stdout + stderr | |
console.log 'baking done. Development flavor.' | |
task 'bake-prod', 'Build project for production use. Compresses lib/bundle.js', -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Item | |
@_itemcount: 0 | |
constructor: -> | |
@constructor._itemcount++ # refers to <classname>._itemcount | |
@id = @constructor._itemcount | |
@note = "" | |
@completed = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define stack | |
(let ((stk '())) | |
(lambda (msg . args) | |
(case msg | |
((peek) (car stk)) | |
((push) (set! stk (cons (car args) stk))) | |
((pop) (let ((result (car stk)) | |
(popped (cdr stk))) | |
(set! stk popped) |
NewerOlder