Skip to content

Instantly share code, notes, and snippets.

@wkentdag
wkentdag / index.jade
Created August 16, 2016 20:53
side-by-side comparison of a simple index page in jade and sugarML. from https://github.com/wkentdag/pow
extends layout
block content
main
section
- var post = locals.data.headlines[0]
#hero(style=bg)
a(href=post.perma)
h1= post.title
img(src= post.image)
.hero-overlay
@wkentdag
wkentdag / index.md
Last active August 16, 2016 18:51 — forked from jescalan/index.md
Differences between jade and the spike-standards stack

Spike v0.11.0 Migration Guide

In this release of spike, we switch posthtml for reshape. Reshape is a complete rewrite of posthtml by the static-dev team with several significant differences:

  • It returns a function by default, so that its results can be used as client-side templates
  • It has a much more clear and robust error reporting system, reporting errors that include the line/col in the original source, and exposing a code snippet to show where it came from
  • It has more clearly written documentation, more thorough tests, consistent code style, and 100% coverage on all core modules

However, as a consequence of this move, the jade plugin is no longer available. The jade plugin was always a hack, and had several crippling caveats. In addition, jade does not fit well with reshape's philosophy of breaking functionality down into small modules. As such, we have replaced ja

'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
Company = mongoose.model('Company'),
Loan = mongoose.model('Loan');
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
NoteSchema = require('./note'),
LoanSchema = require('./loan'),
Loan = mongoose.model('Loan'),
util = require('util'),
@wkentdag
wkentdag / gist:fa95151af79a7daaea7c
Created May 6, 2015 23:19
populating db in production mode
# Make a user
curl -X POST 'http://localhost:3000/users' -d 'first_name=Will&last_name=Test&phone=123456789'
# Make a status
curl -X POST 'http://localhost:3000/status' -d 'owner_id=1&longitude=100&latitude=100&duration=30'
# the above fields are all required. to add viewing permissions to users OTHER than the owner, add:
'&selectedFriends[]=2&selectedFriends[]=5' # etc
# and to add a 160char-max message, add:
'&message="hey there im awesome"'
@wkentdag
wkentdag / gist:4efeb5381601306c82f8
Last active August 29, 2015 14:20
sup api from the command line
Creating a new user:
curl -X POST 'http://localhost:3000/users' # development monde
curl -X POST 'http://localhost:3000/users' -d 'first_name=will&last_name=kd&phone=123456' # production mode
Creating a new status:
curl -X POST 'http://localhost:3000/status' -d 'fake_owner_id=1' # development mode
curl -X POST 'http://localhost:3000/status' -d 'owner_id=6&longitude=666&latitude=111' # production mode
Granting a user permission to view a status:
curl -X POST 'http://localhost:3000/status/:id/viewers' -d 'user_id=6' # :id = valid status id

Study these screenshots:

https://innig.net/tmp/nr-screenshots/

Fork this gist (one fork per team).

Sketch out an object model for this application. Don't worry about view, network, database, etc.; your concern is only to represent the essential information of this application as classes and attributes. You can use the following attribute types:

  • numbers, strings, dates
  • other model classes
@wkentdag
wkentdag / wmcn-tumblr_12515
Created January 26, 2015 01:16
wmcn.tumblr.com @ 1/25/15
<!DOCTYPE html>
<html>
<head>
<!-- "wmcn" theme by will kent-daggett:
[email protected]
github.com/wkentdag
github.com/wkentdag/wmcn-tumblr/