Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
brianjmiller / gist:672556
Last active September 24, 2015 05:08
YUI3 Module template
YUI.add(
"!!!",
function(Y, NAME) {
var Clazz = Y.namespace("!!!").!!! = Y.Base.create(
NAME,
!!!,
[],
{
initializer: function (config) {
Y.log("initializer", "debug", Clazz.NAME);
@brianjmiller
brianjmiller / gist:1540779
Created December 30, 2011 17:49
YUI: Single Template
YUI.add(
"ep-w-work_entry-base",
function (Y) {
var UI = Y.Widget.UI_SRC;
var MODE = "Mode";
var STATUS = "Status";
var WC_AC_SOURCE = "WorkChart/ac?";
var Clazz = Y.namespace("EP.W.WorkEntry").Base = Y.Base.create(
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@jshirley
jshirley / build.js
Created August 1, 2012 17:22
This is a setup I'm using with a YUI_config to leverage Y.Loader to build static rollup files.
/*
This is the Node.js file, it will export files directly to
`tdp-bundle-min.js` which obviously won't work well for you!
This relies on having a YUI_config that can be parsed and
passed into Y.Loader. Everything you need should be in this
gist, though. You may need to change the path to your
YUI_config file (mine is named `bundle.js`).
However, it's an easy change, just scroll down and edit it.
@AvnerCohen
AvnerCohen / npm-cheat-sheet.md
Last active July 9, 2023 09:14
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

List of less common (however useful) NPM commands

Prepand ./bin to your $PATH

Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@timball
timball / ssh_attach.sh
Created December 28, 2012 19:00
ssh_attach is to be sourced from a .profile and connects your shell to previously running ssh-agents . think of it as a slightly functional keymanager for your ssh sessions . --timball
#!/bin/bash
#
# ssh_attach.sh
#
# source this file in a .bashrc .
#
# something like :
#
# # interactive shell ??
# if [ "$PS1" ]; then
@brianjmiller
brianjmiller / gist:5814668
Last active December 18, 2015 16:49
PR template for browser testing
Tested in:
- [ ] Node.js
- [ ] Chrome
- [ ] FireFox
- [ ] Safari
- [ ] IE 11
- [ ] IE 10
- [ ] IE 9
- [ ] IE 8
@brianjmiller
brianjmiller / gist:6174702
Last active December 20, 2015 18:18
Example of changing view through attach/detach
_changeView: function (newView, options) {
console.log("app::_changeView");
options = options || {};
options.renderFirst = (typeof options.renderFirst !== "undefined") ? options.renderFirst : true;
if (this._currentView !== null && this._currentView === newView) {
console.log("app::_changeView - no change needed");
return;
}
@brianjmiller
brianjmiller / base.js
Last active January 1, 2016 20:49
Base BB View
return Backbone.View.extend(
{
_nodes: null,
renderCfg: function () {
return this._renderCfg || {};
},
renderContext: function () {
console.log("views/base::renderContext");
var dbh = require("../migrations"),
relationName = "time_zones";
exports.up = function (next) {
dbh.schema.createTable(
relationName,
function (table) {
table.string("code", 50).primary();
table.timestamps();
table.integer("utc_offset").notNullable();