Skip to content

Instantly share code, notes, and snippets.

View davestacey's full-sized avatar

DaveStacey davestacey

View GitHub Profile
@davestacey
davestacey / 0_with-apollo-auth.md
Created October 23, 2018 14:47
with-apollo-auth

From examples/with-apollo-auth

  • initApollo
@remy
remy / ActiveLink.js
Last active April 12, 2024 08:33
Next.js version of `activeClassName` support.
@davestacey
davestacey / 1olooReport.js
Last active September 16, 2021 20:04
Oloo Reports - Pipe large file - Async builds - zip password and email.
/**
* 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');
@cletusw
cletusw / .eslintrc
Last active February 29, 2024 20:24
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
@derekwheee
derekwheee / gulpfile.js
Last active August 29, 2015 14:01
Gulpfile for VS Projects
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 () {
<?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.
@codexmas
codexmas / gist:3229207
Created August 1, 2012 17:49
JQuery; Drupal; Unbinding Ctools autosubmit on exposed filters
// 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();
}
@hurjas
hurjas / timestamp.js
Created May 11, 2012 15:35 — forked from jonkemp/timestamp.js
Print out a nicely formatted timestamp in JavaScript.
/**
* 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
@topfunky
topfunky / instanceof-example.js
Created March 22, 2012 19:50
example of using instanceof
// 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);
});
};
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name