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
; A REPL-based, annotated Seesaw tutorial | |
; Please visit https://github.com/daveray/seesaw for more info | |
; | |
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
; Seesaw's basic features and philosophy, but only scratches the surface | |
; of what's available. It only assumes knowledge of Clojure. No Swing or | |
; Java experience is needed. | |
; | |
; This material was first presented in a talk at @CraftsmanGuild in | |
; Ann Arbor, MI. |
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
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
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
'use strict'; | |
// This allows you to filter every other click event (first one included) | |
// By making the initial value an object, eliminates type checking | |
// click markedClicks:--------<value: true>--<value: false>---------<value: true>---...etc | |
// oddClicks: --------<value: true>-------------------------<value: true>---...etc | |
// evenClicks: -----------------------<value: false>-------------------------...etc | |
const markedClicks = Kefir.fromEvents(document.body, 'click') | |
.scan((prev, next) => !prev, false) //This can be an object with a shouldFire property if you need to map anything else | |
.skip(1); //This will skip the currentValue called immediately due to the seed |
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 bcrypt = require("bcrypt"), | |
async = require("async"); | |
function genHash(username, password, doneCallback) { | |
async.waterfall([ | |
function(hashCallback) { | |
bcrypt.genSalt(10, hashCallback); | |
}, | |
function(salt, callback) { | |
bcrypt.hash(password, salt, callback); |
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 async = require('async'); | |
module.exports = { | |
userCredentials: [ | |
{ | |
username: 'testUser1', | |
password: 'pa$$word' | |
}, | |
{ | |
username: 'testUser2', |