This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GIFDownloader.h | |
// TheJoysOfCode | |
// | |
// Created by Bob on 29/10/12. | |
// Copyright (c) 2012 Tall Developments. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clang -dynamiclib -framework AppKit patch.m -o patch.dylib | |
env DYLD_INSERT_LIBRARIES=patch.dylib "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ git clone https://github.com/letsencrypt/letsencrypt | |
~ $ cd letsencrypt | |
~ $ letsencrypt-auto --renew-by-default --webroot -w /var/www/ --email [email protected] --text --agree-tos -d website.com -d www.website.com auth | |
~ $ letsencrypt --apache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/* | |
Execute asynchronous tasks concurrently until reaching a given 'max' number. | |
Tasks queued while there is already a 'max' number of concurrent tasks are silently discarded. | |
Usage: ThrottledQueue(1).queueAction { finish in /* work */ finish() } | |
*/ | |
struct ThrottledQueue | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-document domain("safaribooksonline.com") { | |
.card-annotation .annotation-quote, | |
.resizer .draggable-containment-wrapper:after, | |
.resizer .draggable-containment-wrapper:before, | |
body.video, | |
#lesson-fragment, | |
#sbo-rt-content | |
{ | |
font-family: sans-serif !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// a mutex built on a semaphore | |
// see http://www.cocoawithlove.com/blog/2016/06/02/threads-and-mutexes.html | |
struct DispatchSemaphore { | |
let s = dispatch_semaphore_create(1) | |
func sync<R>(@noescape f: () throws -> R) rethrows -> R { | |
_ = dispatch_semaphore_wait(s, DISPATCH_TIME_FOREVER) | |
defer { _ = dispatch_semaphore_signal(s) } | |
return try f() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -a ! -name ".DS_Store" -exec shasum '{}' \; > shasums.txt | |
shasum -c < shasums.txt > check.txt | |
cat check.txt | fgrep -v OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BASIC SWITCH | |
enum Media { case Book } | |
extension Media : CustomStringConvertible | |
{ | |
var description: String { | |
switch self { | |
case .Book: return "bible" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = true | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Mount the Installer image | |
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
# Create El Capitan sparseimage of 7316mb with a Single Partition - Apple Partition Map | |
hdiutil create -o /tmp/ElCapitan -size 7316m -layout SPUD -fs HFS+J -type SPARSE | |
# Mount the El Capitan sparseimage | |
hdiutil attach /tmp/ElCapitan.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build |