Skip to content

Instantly share code, notes, and snippets.

import UIKit
// Copyright 2017 Dan Rosenstark dr2050.com
// See http://stackoverflow.com/a/28570282/8047, too
class GameLoop : NSObject {
var doSomething: () -> ()!
var displayLink : CADisplayLink!
init(doSomething: @escaping () -> ()) {
@bitsandbooks
bitsandbooks / setup.sh
Created June 22, 2014 17:47
Basic setup script for a fresh Ubuntu server. Will set the machine's hostname and install Git, Puppet (with APT module) and ZFS.
#!/usr/bin/env bash
# Basic setup script for a fresh Ubuntu machine. Will set the machine's
# hostname and install Git, Puppet and ZFS.
RELEASE=`lsb_release -s -c`
NAME="servername"
# Set the machine's hostname. If you pass a name as $1, that hostname
# will be used. Otherwise, just change the $NAME variable above.
if [ -n "$1" ]; then; unset $NAME && NAME=$1; fi
@bitsandbooks
bitsandbooks / add-nginx-vhost.sh
Last active June 22, 2017 01:45
My custom script for adding a vhost to Nginx.
#!/usr/bin/env bash
#
# Nginx - new server block
# http://rosehosting.com
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
working() { echo -ne '\e[1;33m'$1'\e[m'; } # Yellow
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; }