Skip to content

Instantly share code, notes, and snippets.

View alyssais's full-sized avatar
🤒
Out sick

Alyssa Ross alyssais

🤒
Out sick
View GitHub Profile

Keybase proof

I hereby claim:

  • I am penman on github.
  • I am penman (https://keybase.io/penman) on keybase.
  • I have a public key whose fingerprint is 9B36 DC74 20E5 0DC0 278D C839 05CC 00A7 63F8 2E0B

To claim this, I am signing this object:

@alyssais
alyssais / mp.json
Last active August 29, 2015 14:03
Contact details for UK MPs, extracted from http://parliament.uk
[
{
"constituency": "Hackney North and Stoke Newington",
"email": "[email protected]",
"id": 172,
"name": "Ms Diane Abbott MP",
"party": "Labour",
"tel": "020 7219 4426",
"twitter": "@hackneyabbott",
"website": "http://www.dianeabbott.org.uk"
import Foundation
typealias Forest = Tree[]
protocol Tree {
func parent() -> Tree?
func nodes() -> Forest
}
func nodes(tree: Tree) -> Forest {
import Darwin
let isLittleEndian = Int(OSHostByteOrder()) == OSLittleEndian
let htons = isLittleEndian ? _OSSwapInt16 : { $0 }
let htonl = isLittleEndian ? _OSSwapInt32 : { $0 }
let htonll = isLittleEndian ? _OSSwapInt64 : { $0 }
let ntohs = isLittleEndian ? _OSSwapInt16 : { $0 }
let ntohl = isLittleEndian ? _OSSwapInt32 : { $0 }
let ntohll = isLittleEndian ? _OSSwapInt64 : { $0 }
#import "socket.h"
@import "web-fonts";
@include web-fonts("Open Sans", "Droid Serif", "Pacifico");
@alyssais
alyssais / jekyll.sh
Created May 3, 2014 22:23
Fixing Jekyll for @Januzellij
brew install rbenv ruby-build
echo "eval $(rbenv init -)" >> ~/.zshrc
source ~/.zshrc
rbenv install 2.1.1
rbenv global 2.1.1
gem install jekyll
rbenv rehash
@alyssais
alyssais / gist:61edce0ad8893575b293
Created May 3, 2014 21:56
Extracting an imported EPUB from iBooks for Mac
  1. Go to ~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books/
  2. Locate the folder for the book (the name will have been changed to a randomized string)
  3. Compress the folder into a .zip
  4. Change the .zip extension to .epub

And you thought iTunes was bad.

@alyssais
alyssais / IIIAsync.podspec
Created April 10, 2014 17:03
A podspec for IIIAsync
Pod::Spec.new do |spec|
spec.name = 'IIIAsync'
spec.version = '0.2.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/stevestreza/IIIAsync'
spec.authors = { 'Steve Streza' => '[email protected]' }
spec.summary = 'Concurrency control flow system for Objective-C'
spec.source = { :git => 'https://github.com/stevestreza/IIIAsync.git', :commit => '4e403e1a27542b7fa5defd49416d30930eb3b540' }
spec.source_files = 'IIIAsync/IIIAsync.{h,m}'
spec.requires_arc = true
@alyssais
alyssais / async.rb
Created April 7, 2014 12:27
A Ruby implementation of a waterfall control flow thingy.
module Async
class << self
def waterfall(objects, handler, &block)
enumerator = objects.each
prev_result = nil
run_next = lambda do
begin
# onwards!
prev_result = handler.(enumerator.next, prev_result) do |success|
success ? run_next.call : block.(false)