Skip to content

Instantly share code, notes, and snippets.

@indigo0086
indigo0086 / auth.js
Created February 2, 2014 03:45
Very simple user authentication using async
var async = require('async');
module.exports = {
userCredentials: [
{
username: 'testUser1',
password: 'pa$$word'
},
{
username: 'testUser2',
@indigo0086
indigo0086 / genHash.js
Created February 3, 2014 22:21
async.js with bcrypt
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);
@indigo0086
indigo0086 / recipes.js
Last active March 16, 2016 18:56
Kefir Recipes
'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
@indigo0086
indigo0086 / .eslintrc
Created March 18, 2017 22:07 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// 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
; 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.