Skip to content

Instantly share code, notes, and snippets.

View serby's full-sized avatar
😃
Joyful

Paul Serby serby

😃
Joyful
View GitHub Profile
@serby
serby / fix.html
Created October 3, 2013 14:05
breadcrumb fixer for NUD
<script>
// Add this block as an HTML widget to an articleLayout
// You will also need to add a promo image widget to the layout with the header that you wamt
// between the breadcrumb and the artcile content.
document.addEventListener('DOMContentLoaded', function(){
$('.breadcrumbs').after($('.js-widget-promo'))
})
</script>

Git branch naming convention

Furthr to the Git Flow branching model, I propose the following style, workflow and naming convention for Git branches.

Constant Branches

Repos will always have these branches.

master - Stable production version

@serby
serby / tabs-cycle.js
Last active December 17, 2015 12:39
Cycle all tabs in chrome for 1 minute.
var i = 0;
if (typeof cycleInt !== 'undefined') clearInterval(cycleInt);
function interval() {
chrome.tabs.getAllInWindow(onAllTabs)
}
function onAllTabs(tabs) {
if (i >= tabs.length) i = 0;
chrome.tabs.update(tabs[i++].id, { active: true })
var q = []
function (req, res) {
q.push(function (cb) {
resize(req.body, function(error, complete) {
res.send(complete)
cb()
})
})
}
✖ 6 of 65 tests failed:
1) memory-engine #create() should emit a 'afterCreate' event:
actual expected
{
"_id": "00000001bb8206ef4600000500000001bb8206ef46000004"
}
@serby
serby / gist:5323296
Last active December 15, 2015 21:09
pliers lint
23:44:57 [pliers] Debug mode
23:44:57 [pliers] Running task: lint
23:44:57 [pliers] Executing ./node_modules/jshint/bin/jshint .
public/js/app/api-error/index.js: line 9, col 3, 'parentSyncMethod' is not defined.
public/js/app/api-error/index.js: line 36, col 11, 'parentSyncMethod' is not defined.
public/js/app/api-error/index.js: line 49, col 5, 'parentSyncMethod' is not defined.
public/js/app/api-error/index.js: line 4, col 42, 'serviceLocator' is defined but never used.
public/js/app/lib/image-crop-helper.js: line 13, col 4, Expected '}' to have an indentation at 5 instead at 4.
module.exports = render
var renderJade = require('../lib/render-jade')
, template = renderJade(__dirname + '/templates/section.jade')
, rowView = require('./row')
, async = require('async')
, _ = require('lodash')
, navigationView = require('./navigation')
, createDeduper = require('fleet-street/lib/deduper')
var a =
{ "author" : "Author"
, "state" : "Published"
, "section" : "5158bfc0e5aa20eb5c000001"
, "preTitleHtml" : "<p>PreTitleHtml</p>"
, "longTitle" : "LongTitle"
, "shortTitle" : "ShortTitle"
, "subTitle" : "subTitle"
, "slug" : "articlea"
, "standfirst" : "standFirst"
var
gm = require('gm'),
properties = require('../../properties').getProperties(),
fs = require('fs');
module.exports.createImageManager = function() {
function resizeAndCrop(hash, filename, width, height, crop, callback) {
var
newCachedLocation,
@serby
serby / image.js
Last active December 15, 2015 10:19
{ '2:3':
{ w: 2000
, h: 3000
, x1: 0
, y1: 0
, x2: 200
, y2 300
}
}