Skip to content

Instantly share code, notes, and snippets.

View serby's full-sized avatar
😃
Joyful

Paul Serby serby

😃
Joyful
View GitHub Profile
const createServer = require('./server')
const componentLoader = require('component-loader')
const glob = require('glob')
const { join } = require('path')
// Use this for standard environment setup that is need on all entry points.
// This will often be where components are initialised
module.exports = (serviceLocator, jobRunnerMode = false, cb) => {
const server = createServer(serviceLocator)
#import "WifiWizard2.h"
#include <ifaddrs.h>
#import <net/if.h>
#import <SystemConfiguration/CaptiveNetwork.h>
#if !TARGET_IPHONE_SIMULATOR
#import <NetworkExtension/NetworkExtension.h>
#endif
#include "Energia.h"
#ifndef __CC3200R1M1RGC__
// Do not include SPI for CC3200 LaunchPad
#include <SPI.h>
#endif
#include <WiFi.h>
#include <SLFS.h>
#include <inc/hw_types.h>
#include <inc/hw_ints.h>
###### # ###### ###### # #
# # # # # # # # #
# # # # # #####
# # # # # # #
# # # # # # # # #
###### ######## ###### ###### # #
@serby
serby / 70k.js
Created February 15, 2016 14:24
const size = 74 * 1024
var packet = { name: 'Paul Serby', email: 'paul.serby@clock.co.uk' }
, packetSize = JSON.stringify(packet).length
, count = Math.round(size / packetSize)
, buffer = []
, i
, time = Date.now()
, bigPacket = Array(size).fill('X')
for (i = 0; i < count; i++) {
@serby
serby / walk.js
Created October 4, 2014 20:55
Walk an object and print the javascript accessor for each leaf element
function walk(parent, obj) {
if (Array.isArray(obj)) {
obj.forEach(function (a, i) {
walk(parent + '[' + i + ']', a)
})
} else if (obj !== null && typeof obj === 'object') {
Object.keys(obj).forEach(function (key) {
walk(parent + '.' + key, obj[key])
@serby
serby / commit-style-guide.md
Last active August 29, 2015 14:00
Clock Commit Style Guide

Clock Committing Style Guide

To allow us to automatically create a good quality changelog from our git history we recommend the following formats for commit messages.

The aim is to capture a reference to any ticket, card, or story that this commit contributes towards.

Because we are now using the Pivotal Tracker Webhook on some projects we suggest wrapping your commit message prefix with square brackets []

http://pivotallabs.com/level-up-your-development-workflow-with-github-pivotal-tracker/

@serby
serby / hotspot.js
Last active August 29, 2015 13:58
var krpano = $('#krpanoObject')[0]
, p = $('#krpanoObject')[0]
p.call('addhotspot("jim")')
p.set('hotspot["jim"].url', 'http://upload.wikimedia.org/wikipedia/en/e/e0/Black_Down_Arrow.png')
p.set('hotspot[jim].ath',150)
p.set('hotspot[jim].atv',15)
p.set('hotspot[jim].scale',0.4)
p.set('hotspot[jim].zoom',true)
module.exports = createAdaptor
var Db = require('mongodb').Db
, ReplSetServers = require('mongodb').ReplSetServers
, Server = require('mongodb').Server
, _ = require('lodash')
/*
* Create an object that has a reference
* to the database, and a helper function to
curl -vo /dev/null -H 'host: codes.thesun.co.uk' http://suncodes.clockhosting.com/api/exists