NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
// NOTE: `app` parameter is an instance of Express.js. | |
module.exports = function(app) { | |
var socketIO; | |
socketIO = require('socket.io').listen(app); | |
socketIO.sockets.on('connection', function(socket) { | |
console.log("CONNECTED"); | |
console.log(socket instanceof socket.constructor); | |
}); | |
}; |
/** | |
* Return a timestamp with the format "m/d/yy h:MM:ss TT" | |
* @type {Date} | |
*/ | |
function timeStamp() { | |
// Create a date object with the current time | |
var now = new Date(); | |
// Create an array with the current month, day and time |
// Unbind ctools textfield binding | |
$('input[type=text].ctools-auto-submit:not(.ctools-auto-submit-processed),.ctools-auto-submit-full-form input[type=text]:not(.ctools-auto-submit-processed)').unbind('keyup'); | |
// Bind to any textfield widgets that will be auto submitted. | |
$('input[type=text].ctools-auto-submit:not(.ctools-auto-submit-processed),.ctools-auto-submit-full-form input[type=text]:not(.ctools-auto-submit-processed)') | |
.addClass('.ctools-auto-submit-processed') | |
.blur(function () { | |
var form = this.form; | |
if (!$(form).hasClass('ctools-ajaxing')) { | |
$(form).find('.ctools-auto-submit-click').click(); | |
} |
<?php | |
/** | |
* @file | |
* Default theme implementation to display the basic html structure of a single | |
* Drupal page. | |
* | |
* Variables: | |
* - $css: An array of CSS files for the current page. | |
* - $language: (object) The language the site is being displayed in. |
var gulp = require('gulp'), | |
beep = require('beepbeep'), | |
plumber = require('gulp-plumber'), | |
sass = require('gulp-ruby-sass'), | |
prefix = require('gulp-autoprefixer'), | |
rimraf = require('gulp-rimraf'), | |
colors = require('colors'); | |
// Compile Sass with Source Maps | |
gulp.task('sass-dev', ['clean-css'], function () { |
{ | |
// 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 |
/** | |
* Report Creation - OLOO Method | |
*/ | |
var BPromise = require('bluebird'); | |
var _ = require('lodash'); | |
var fs = BPromise.promisifyAll(require("fs")); //This is most convenient way if it works for you | |
var path = require('path'); | |
var moment = require('moment-timezone'); | |
var Account = require('../../src/models/Account'); |
import { withRouter } from 'next/router'; | |
import Link from 'next/link'; | |
import React, { Children } from 'react'; | |
const ActiveLink = ({ router, children, ...props }) => { | |
const child = Children.only(children); | |
let className = child.props.className || ''; | |
if (router.pathname === props.href && props.activeClassName) { | |
className = `${className} ${props.activeClassName}`.trim(); |