Skip to content

Instantly share code, notes, and snippets.


David Mosher davemo

View GitHub Profile
stevenharman / gemfresh
Last active Sep 27, 2022
gemfresh: A handy script for determining the freshness of dependencies in a Ruby code base. Leverages bundler and libyear-bundler.
View gemfresh
#!/usr/bin/env bash
# shellcheck disable=SC2059
set -euo pipefail
unsalted /
Last active Jun 4, 2021
Sierra 10.12.3 Hackintosh | Asus z170-A, Intel i5 6500, MSI GTX 960 OC, GTX1070(Dormant)

Sierra 10.12.3 Hackintosh

This is my build documentation for an ASUS Z170-A setup with an NVIDIA GTX960 and the Intel i5 6500, most of this came from Storks asus rog maximus build, his audio instructions didn't work for me so it differs substantially there. This build also doesn't have NVRAM. Nearest I can tell everything is running as expected, including all USB and audio ports.


  • Asus Z170-A
  • Intel Core i5-6500
  • Crucial Ballistix Sport LT 32GB (2 x 16GB) DDR4-2400 Memory
  • MSI GeForce GTX 960 4GB Installed in slot 1!
searls / layout.html.erb
Created Aug 27, 2014
Delay implementing a PDF rendering feature by beating Chrome into submission instead
View layout.html.erb
<%= stylesheet_link_tag "application", :media => "screen,print" %>
cobyism /
Last active Nov 30, 2022
Command to create installable OS X USB drive.

Creating a bootable macOS USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the macOS installer sitting in /Applications/Install\ macOS\ [VERSION].app, run the following command in your terminal to create a bootable install media (for Sierra):

sudo /Applications/Install\ macOS\ --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ --nointeraction
searls / git-unpull
Created Aug 29, 2013
a handy way to unpull a pull that bit off more than you could chew.
View git-unpull
git reset --hard HEAD@{1}
jpillora /
Last active Apr 30, 2018
Micro JavaScript Dependancy Injection.Written in CoffeeScript / JS.This is *approximately* how AngularJS works.
# Micro JavaScript Dependancy Injection
define = (name, val) ->
#init modules map if missing
define.mods = define.mods or {}
#store 'name'
define.mods[name] = val
inject = (fn) ->
#regex match on function.toString()
davemo / jquery.touch.js
Last active Nov 2, 2016 — forked from twalling/jquery.touch.js
Zeptos touch events, ported to work inside jQuery, including jQuery Mobiles scroll suppression.
View jquery.touch.js
var touch = {},
touchTimeout, tapTimeout, swipeTimeout,
longTapDelay = 750, longTapTimeout
function parentIfText(node) {
return 'tagName' in node ? node : node.parentNode
function swipeDirection(x1, x2, y1, y2) {
cowboy / Gruntfile.js
Created Jan 9, 2013
grunt: lineman idea
View Gruntfile.js
module.exports = function(grunt) {
// stuff
// Default task.
grunt.registerTask('default', ['run']);
fxsjy / gist:3291755
Last active Jan 9, 2021
Memcached in JavaScript based on Node.JS
View gist:3291755
//author: Sun, Junyi (
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 300 // default 100M bytes
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on
igrigorik / gist:3148848
Created Jul 20, 2012
Convert any YouTube video into an audio file you can listen to on the go...
View gist:3148848
# Convert any YouTube video into an audio file you can listen to on the go, using:
{ ~ } > brew install ffmpeg
{ ~ } > wget
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F