Skip to content

Instantly share code, notes, and snippets.

View borestad's full-sized avatar

Johan Borestad borestad

View GitHub Profile
(function() {
var s = document.createElement('script');
s.src = 'http://localhost:8000/player.js'
document.body.appendChild(s);
})()
@borestad
borestad / elcapitan-bootable-usb.sh
Last active January 13, 2016 06:22
Bootable USB Drive for OS X El Capitan
###
# This script assumes 2 things
# 1. One have already downloaded the El Capitan ( /Applications/Install OSX El Capitan.app) installer through Appstore or at leaast put "Install OSX El Capitan.app" into the /Apps folder
# 2. A fresh 8 GB+ USB Memory is inserted and have the name "Untitled"
#
# Installation instructions:
# 1. Insert a USB stick into your computer (it will be totally erased - make sure you backup your important files on that USB)
# 2. Open up a terminal (Terminal.app, iTerm etc)
# 3. Fire up Disk utilities
# - I.e `open /Applications/Utilities/Disk\ Utility.app`
###
# This script assumes 2 things
# 1. One have already downloaded the yosemite installer through Appstore or at leaast put "Install OS X Yosemite.app" into the /Apps folder
# 2. A fresh 8 GB+ USB Memory is inserted and have the volume name "Untitled"
#
###
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
@borestad
borestad / yosemite-to-iso.sh
Last active October 8, 2015 09:42
Yosemite to ISO
#!/bin/bash
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.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/Yosemite
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Yosemite.sparseimage
#!/bin/bash
# Usage: bash <(curl -sL http://bit.ly/1KhQDUU)
# https://confluence.atlassian.com/display/BITBUCKET/ssh-keys+Resource
echo "\n"
printf "Bitbucket account name: "
read account
printf "Bitbucket user: "
@borestad
borestad / bootstrap.sh
Last active September 2, 2015 06:09
Debian Jessie custom/stripped KVM host with some useful tools (on a Macbook Air)
wget --no-cache -O- https://gist.githubusercontent.com/borestad/ddab79ed5d3412248eed/raw/f7050315505df4287bd54ca514b0a94c7f1848ff/install.sh | /bin/bash
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
========= server.coffee ===========
server.coffee
express = require 'express'
engines = require 'consolidate'
#sugar = require './assets/javascripts/vendor/sugar'
# Create ExpressServer
app = express()
exports.startServer = ((config) ->