Skip to content

Instantly share code, notes, and snippets.

View baldwicc's full-sized avatar

Chris Baldwin baldwicc

View GitHub Profile
@baldwicc
baldwicc / ExpandAllRecords.M
Last active September 7, 2020 10:42 — forked from Mike-Honey/ExpandAllRecords.M
ExpandAllRecords function for Power Query or Power BI - expands all record-type columns recursively
// Based on Chris Webb's blog post - http://blog.crossjoin.co.uk/2014/05/21/expanding-all-columns-in-a-table-in-power-query/
let
// Define function taking two parameters - a table and an optional column number
Source = (IncomingTableToExpand as table, optional ColumnNumber as number) =>
let
// Buffer the table for performance
TableToExpand = Table.Buffer(IncomingTableToExpand),
@baldwicc
baldwicc / brew-update-notifier.sh
Created September 13, 2016 01:29 — forked from SimonSimCity/brew-update-notifier.sh
Extended the script, written by @streeter to exclude the pinned formulae in the list of formulas to update.
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: terminal-notifier. Install with:
# brew install terminal-notifier
TERM_APP='/Applications/Terminal.app'
BREW_EXEC='/usr/local/bin/brew'
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function () {
return (root.returnExportsGlobal = factory());
});
}
else if (typeof exports === 'object') {
module.exports = factory();
}
else {
#!/bin/bash
# This script is edited by Brice Dutheil
# See there in french http://blog.arkey.fr/2012/07/30/script-pour-installer-le-jdk-5-sur-macosx-lion/
# Translate button is broken for now, please use Google to translate this website.
#
# 2014/02/10 Updated the script to run on OSX 10.9 Maverick
#
# 2013/05/11 Added a few more guidance when Java Preferences is not available anymore
# Added a simple example of a JDK switch function.
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
# Borrowed from https://gist.github.com/quickshiftin/9130153
if which brew &> /dev/null; then
if brew list | grep coreutils &> /dev/null; then
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _'
fi
fi
@baldwicc
baldwicc / gist:f9c28f366d8c8d0eb80e
Last active August 29, 2015 14:02 — forked from remy/gist:350433
sessionStorage and localStorage Polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();