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
/* | |
* Author: WORMSS | |
* | |
* Blink with no Delay | |
* - This allows for multiple LEDs to be used. | |
* - This allows for delayed start of sequence. | |
* - This allows for different on and off delays. | |
* | |
* Instructions: | |
* - Change the LENGTH variable below with the amount of LEDs you wish to use. |
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
/* | |
* Author: WORMSS | |
* | |
* Blink with no Delay | |
* - This allows for multiple LEDs to be used. | |
* - This allows for delayed start of sequence. | |
* - This allows for different on and off delays. | |
* | |
* Instructions: | |
* - Change the LENGTH variable below with the amount of LEDs you wish to use. |
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
/** | |
* @author Colin Richardson | |
* | |
* @description this script in combination with a chrome extension enviroment adds i18n capabilities to html pages without jQuery. | |
* html elements will need a data-i18n tag with the message name and will be placed within the elements innerHTML attribute. | |
* | |
* This can be expanded/modified with the use of data-i18n-attr and place the name of the attribute you wish to assign the message to. | |
* EG: title, value, etc etc | |
* EG: data-i18n-attr="title", data-i18n-attr="value", etc etc | |
* |
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
# Make octopus from current commit/index | |
commit_id=$(git commit-tree $(git write-tree) -p commit1 -p commit2 -p commit3 -m "Octopus Message") | |
git branch -f "tmp/octopus" "$commit_id" |
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
## Installing Chrome on Rasbian ## | |
# https://www.raspberrypi.org/forums/viewtopic.php?t=121195 # | |
wget https://dl.dropboxusercontent.com/u/87113035/chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb -P ~/Downloads/ | |
wget https://dl.dropboxusercontent.com/u/87113035/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb -P ~/Downloads/ | |
wget https://dl.dropboxusercontent.com/u/87113035/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb -P ~/Downloads/ | |
sudo dpkg -i ~/Downloads/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb | |
sudo dpkg -i ~/Downloads/chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb ~/Downloads/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb | |
## So Chrome shows up in the Application Launch Bar ## |
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
/* | |
Some extra stuff for setting up the server | |
*/ | |
// Setting up bare passport. No Auth Strategy. | |
const passport = require("./middlewear/my-passport-init"); | |
app.use(passport.initialize()); | |
app.use(passport.session()); | |
// Setting up passport Strategies and Routes |
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
const Router = require("express").Router; | |
///........ | |
const ensuredLoggedIn = require('connect-ensure-login').ensureLoggedIn(); | |
var app = new Router(); | |
app.get("/", ensuredLoggedIn, (req, res) => { | |
// ............. | |
}); |
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
const Express = require("express"); | |
const methodOverride = require("method-override"); | |
const app = new Express(); | |
const router = new Express.Router(); | |
//app.use(methodOverride("_method", {"methods": ["POST", "GET"]})); // Works too. | |
router.use(methodOverride("_method", {"methods": ["POST", "GET"]})); // on route so only the following use the method override. | |
router.get("/:id", all("get")); |
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
// imports | |
const Express = require("express"); | |
const bodyParser = require("body-parser"); | |
// Some datastore to play with. | |
const bookDb = initDb(); | |
// Set up express app. | |
const app = new Express(); |
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 _db; | |
module.exports = { | |
connect: function ({host = "localhost", port = 27017, dbname = "exampleDb"} = {}) { | |
return require("mongodb").MongoClient.connect(`mongodb://${host}:${port}/${dbname}`) | |
.then(db => _db = db); | |
}, | |
collection: function (col_name) { | |
if ( !_db ) { | |
return null; |
OlderNewer