==========================
this will use derby-templates to render emails from files.
the controller is just a module with view functions attached to it, it can be an empty object otherwise.
| app = module.exports = require('derby').createApp 'component-examples', __filename | |
| app.serverUse module, 'derby-stylus' | |
| app.loadViews __dirname | |
| app.loadStyles __dirname | |
| app.use require 'l-progress/example' | |
| # add more components here... | |
| app.get '/', -> | |
| componentNames = [] |
| # Whitelist collections | |
| ALLOW_COLLECTIONS = { | |
| 'accounts': true | |
| 'users': true | |
| } | |
| module.exports = (shareClient) -> | |
| # Hold on to session object for later use. The HTTP req object is only | |
| # available in the connect event | |
| shareClient.use 'connect', (shareRequest, next) -> |
| MONTH_NAMES = [ | |
| 'January', 'February', 'March', 'April', 'May', 'June', | |
| 'July', 'August', 'September', 'October', 'November', 'December' | |
| ] | |
| moment = (input, format, lang, strict) -> | |
| moment = require 'moment-timezone' | |
| return moment input, format, lang, strict | |
| formats = |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| /** | |
| * jQuery event "tap" (Based on https://developers.google.com/mobile/articles/fast_buttons) | |
| * | |
| * @author RubaXa <trash@rubaxa.org> | |
| * @license MIT | |
| */ | |
| (function (window, $){ | |
| var | |
| support = window.TapSupportEnabled && ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch |
| <div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div> | |
| <input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" /> | |
| <script type="text/javascript"> | |
| var appendConsole = function(message, type) { | |
| var color = "black"; | |
| if (type === "error") { | |
| color = "red"; | |
| } else if (type === "debug") { |
| #make a hook | |
| store.hook 'change', 'collection.*.foo', (docId, value, op, session, backend) -> | |
| model = store.createModel() | |
| #logic | |
| #setup the hook method | |
| store.hook = (method, pattern, fn) -> | |
| store.shareClient.use 'after submit', (shareRequest, next) -> | |
| {opData} = shareRequest |