Skip to content

Instantly share code, notes, and snippets.

View jasondaihl's full-sized avatar

Jason Daihl jasondaihl

View GitHub Profile
@jasondaihl
jasondaihl / index.html
Created August 14, 2017 10:46
JS Bin getElementsByTagName // source https://jsbin.com/vibosan/2
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="getElementsByTagName">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<section id="wrapper">
# Install Caskroom
brew tap caskroom/cask
brew install brew-cask
brew tap caskroom/versions
# Install packages
apps=(
alfred
@jasondaihl
jasondaihl / .osx
Last active January 8, 2016 15:00
#!/usr/bin/env bash
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General #
#!/bin/sh
dockutil --no-restart --remove all
dockutil --no-restart --add "/Applications/2Do.app"
dockutil --no-restart --add "/Applications/Microsoft Outlook.app"
dockutil --no-restart --add "$HOME/Applications/HipChat.app"
dockutil --no-restart --add "$HOME/Applications/Slack.app"
dockutil --no-restart --add "/Applications/Messages.app"
dockutil --no-restart --add "$HOME/Applications/Safari.app"
dockutil --no-restart --add "$HOME/Applications/Google Chrome.app"
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap homebrew/versions
brew tap homebrew/dupes
brew tap Goles/battery
brew update
brew upgrade
# Install packages
@jasondaihl
jasondaihl / pmset-macbook-pro.sh
Last active October 31, 2015 05:20
Prevent MacBook Pro from hibernating when the lid is closed
# `autopoweroff` is enabled by default on supported platforms as an implementation of Lot 6 to the Euro-
# pean Energy-related Products Directive. After sleeping for <autopoweroffdelay> seconds, the system
# will write a hibernation image and go into a lower power chipset sleep. Wakeups from this state will
# take longer than wakeups from regular sleep.
#
# `hibernatemode = 0` by default on desktops. The system will not back memory up to persistent storage.
# The system must wake from the contents of memory; the system will lose context on power loss. This
# is, historically, plain old sleep.
#
# `hibernatemode = 3` by default on portables. The system will store a copy of memory to persistent stor-
@jasondaihl
jasondaihl / mustard
Created April 16, 2014 12:43
Cutting the mustard
// http://responsivenews.co.uk/post/18948466399/cutting-the-mustard
if('querySelector' in document && 'localStorage' in window && 'addEventListener' in window) {
// bootstrap the javascript application
}

Imagine you have a file called foo.txt and your Git history looked like this:

A -> B -> C (HEAD)

Let's see each commit we made:

A == foo