Skip to content

Instantly share code, notes, and snippets.

View dzcpy's full-sized avatar
🎯
Focusing

dzcpy

🎯
Focusing
View GitHub Profile
@dzcpy
dzcpy / gist:c76da5bbf437356ea64b
Last active October 7, 2015 08:22 — forked from devzendo/gist:3a474908b71b66ffa9d7
Getting started with Arduino Micro, 1602A LCD, I2C LCD backpack.
// Using https://arduino-info.wikispaces.com/LCD-Blue-I2C
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
lcd.begin(16, 2);
/**
* Simple authentication and authorization example with passport, node_acl,
* MongoDB and expressjs
*
* The example shown here uses local userdata and sessions to remember a
* logged in user. Roles are persistent all the way and applied to user
* after logging in.
*
* Usage:
* 1. Start this as server
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};
@dzcpy
dzcpy / mclarens.js
Created November 3, 2013 06:10 — forked from nikhilm/mclarens.js
/*
* Mclarens Bar: Redis based Instant Messaging
* Nikhil Marathe - 22/04/2010
* A simple example of an IM client implemented using
* Redis PUB/SUB commands so that all the communication
* is offloaded to Redis, and the node.js code only
* handles command interpretation,presentation and subscribing.
*
* Requires redis-node-client and a recent version of Redis