Skip to content

Instantly share code, notes, and snippets.

View zachdunn's full-sized avatar

Zach Dunn zachdunn

View GitHub Profile
@zachdunn
zachdunn / .zshrc
Last active December 3, 2018 12:59
Theme for oh my zsh
# ... (Find this section in your local .zshrc to replace)
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git osx terminalapp zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# ...
@zachdunn
zachdunn / papa-parse-angular-alias.js
Last active June 12, 2016 19:50
Promisify Papa Parse for Angular
(function () {
'use strict';
// Papa Parse: http://papaparse.com/
// Allows Angular apps to neatly inject `Papa` in components.
angular.module('appName').constant('Papa', window.Papa);
}).call(this);
@zachdunn
zachdunn / add-invitees.json
Created April 25, 2016 22:58
Robin API: Event Example
{
"title": "Core Competency Synergies",
"started_at": "2014-11-01T00:23:45Z",
"ended_at": "2014-11-01T01:23:45Z",
"invitees": [
{
"email": "robin_attendee@domain.com",
"display_name": "Attendee 1",
},
{
@zachdunn
zachdunn / time-utils.js
Created April 15, 2016 15:29
Utils for working with timestamps
import moment from 'moment';
import _ from 'lodash';
/**
* Transform given timestamp properties into moment objects
* Example usage:
* myEvent = transformTimestamps(myEvent, ['started_at', 'confirmation.confirmed_at'])
* @param {Object} targetObject Object to transform properties for
* @param {Array} targetKeys Array of paths to timestamp property
* @return {Object} Transformed targetObject

Keybase proof

I hereby claim:

  • I am zachdunn on github.
  • I am zachdunn (https://keybase.io/zachdunn) on keybase.
  • I have a public key whose fingerprint is 5EC4 20A3 79C7 8F96 6C71 519D AC0A D429 B93C FB72

To claim this, I am signing this object:

// Modified: https://github.com/EmilTholin/node-exchange-autodiscover/blob/master/lib/index.js
'use strict';
var Promise = require('bluebird');
var rp = require('request-promise');
var dnsResolve = Promise.promisify(require('dns').resolve);
var parseString = Promise.promisify(require('xml2js').parseString);
const EWS_URL_SETTING = 'ExternalEwsUrl';
/**
@zachdunn
zachdunn / handy-excel.vba
Created March 11, 2016 15:22
Handy Excel Formulas
// Convert ISO8601 timestamp to usable date by stripping timezone offset
=DATEVALUE(MID(A1, 1, 10)) + TIMEVALUE(MID(A1, 12, 8))
// Obscure email address
// Example: alice@robinpowered.com > al***@robinpowered.com
=SUBSTITUTE(A2, MID(A2, 3, FIND("@",A2) - 3), REPT("*", LEN(MID(A2, 3, FIND("@", A2) - 3 ))))
(function () {
'use strict';
/**
* Broadcast changes to the page's visibility (via page visibility API)
* Source: https://gist.github.com/sym3tri/9357439
*/
function VisibilityService ($document, $rootScope, _) {
var document = $document[0],
features,
detectedFeature;
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@zachdunn
zachdunn / arrow.svg
Last active December 18, 2015 03:29
Time series using range input and smart markers. Built off a AngularJS directive structure.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.