Skip to content

Instantly share code, notes, and snippets.

View danemacaulay's full-sized avatar

Dane Macaulay danemacaulay

View GitHub Profile
var now = new Date();
var fullDaysSinceEpoch = Math.floor(now / 8.64e7)
function initChart() {
return new CanvasJS.Chart('chartContainer', {
title: {
text: 'Inform Times'
},
axisX:{
valueFormatString: 'HH:mm'
@danemacaulay
danemacaulay / .gitignore_global
Created June 25, 2015 16:20
global gitignore
*~
.DS_Store
.floo
.sublime-project
node_modules
# Compiled source #
###################
*.com
*.class
@danemacaulay
danemacaulay / .gitconfig
Created June 25, 2015 16:19
Git config
[user]
name = Dane Macaulay
email = MacaulayD@DNB.com
[core]
excludesfile = /Users/danemacaulay/.gitignore_global
editor = subl -n -w
ignorecase = false
[pager]
log = diff-highlight | less
show = diff-highlight | less
[alias]
co = checkout
cm = commit
st = status
br = branch
@danemacaulay
danemacaulay / auto-login.js
Created June 3, 2015 15:30
auto-login.js
watch();
function login(){
var username = 'username';
var pass = 'password';
var injector = angular.element(document.body).injector();
var $http = injector.get('$http');
var data = "username="+encodeURIComponent(username)+"&password="+encodeURIComponent(pass);
$http({
method: 'POST',
'use strict';
var string = require('string');
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var cheerio = require('cheerio');
glob('app/**/*.html', {}, function(er, files) {
@danemacaulay
danemacaulay / Vagrantfile
Created April 24, 2015 20:17
java6 vagrantfile
require 'rbconfig'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise32"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
function setAuthenticationHeaders(config, authService) {
// Is this a local URL? If so, add auth headers, but don't overwrite
// any that are not already set - this allows someone to pass in
// overrides if so desired.
//
// Note: we don't want to send out headers to URLs that will go out to
// the CDN. This would be very bad. This path check should be sufficient
// to that end.
if (config.url.indexOf('/DNB360UIAgent/') === 0) {
var authHeaders = authService.authHeaders();
@danemacaulay
danemacaulay / helpers.js
Created November 8, 2014 18:03
console log shim for older browsers
(function () {
'use strict';
window.console = window.console || {};
if (typeof Envjs !== 'undefined') {
return;
}
var methodNames = [
'assert',
'clear',
:host:www.gstatic.com
:method:GET
:path:/og/_/js/k=og.og2.en_US.5iiIdIiN4rc.O/rt=j/m=sy0,sy2,sy3,drt,sy4,sy9,def/rs=AItRSTO15owAcNqlvIuGBQd8SJPdBIe15w
:scheme:https
:version:HTTP/1.1
accept:*/*
accept-encoding:gzip,deflate,sdch
accept-language:en-US,en;q=0.8
cache-control:no-cache
pragma:no-cache