Skip to content

Instantly share code, notes, and snippets.

View jmshal's full-sized avatar

Jacob Marshall jmshal

  • New Zealand
View GitHub Profile
@jmshal
jmshal / install.sh
Last active December 23, 2015 02:39
Installs node + npm (latest) from source, for Ubuntu.
#!/bin/bash
# Get the current working directory
location=`pwd`
# Log file
log='node-install.log'
# Temp dir
temp='.node'
@jmshal
jmshal / commands.sh
Created January 16, 2014 22:14 — forked from raultm/commands.sh
# Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Mavericks.sparseimage
/**
* Read the value of a header in the current document.
*
* This uses a [single] XMLHTTPRequest to do a HEAD of the current document
* and fetch HTTP response header values. Note that the implementation is
* rather stupid in that it spins waiting for the XMLHTTPRequest to complete
* if it hasn't been called yet.
*
* @param name string
@jmshal
jmshal / Vagrant.sh
Created May 17, 2014 01:04
Vagrant Setup for Laravel
#!/usr/bin/env bash
# Forked from 'laracasts/Vagrant-Setup', with comments removed.
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo apt-get update
@jmshal
jmshal / bugsnag.js
Created June 18, 2014 08:57
Bugsnag & Browserify
//
// **Bugsnag.js** is the official JavaScript notifier for
// [Bugsnag](https://bugsnag.com).
//
// Bugsnag gives you instant notification of errors and
// exceptions in your website's JavaScript code.
//
// Bugsnag.js is incredibly small, and has no external dependencies (not even
// jQuery!) so you can safely use it on any website.
//
@jmshal
jmshal / example.js
Created June 18, 2014 09:17
Bugsnag & Browserify
var Bugsnag = require('bugsnag-js');
Bugsnag.apiKey = 'YOUR-API-KEY-HERE';
throw new Error('Hello World');
@jmshal
jmshal / designer.html
Created August 15, 2014 23:22
designer
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
// Created by Max Luster (@maxluster)
// Usage instructions at https://bugsnag.com/blog/responsive-typography-with-chained-media-queries
// Requires SASS >= 3.3
// Enhanced by Breakpoint 2.4.x and Compass 1.0 (alpha)
// For SASS 3.2.x support, use https://gist.github.com/maxluster/c9ecc6e4a6770e507c2c
// Provides a simplified syntax for chaining media queries across named or numeric breakpoints
@mixin responsive($properties, $default-value, $responsive-values){
// No named breakpoints by default
// Red
$color-red-50: #fde0dc;
$color-red-100: #f9bdbb;
$color-red-200: #f69988;
$color-red-300: #f36c60;
$color-red-400: #e84e40;
$color-red-500: #e51c23;
$color-red-600: #dd191d;
$color-red-700: #d01716;
$color-red-800: #c41411;