Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
FROM node:latest | |
RUN apt-get update && \ | |
apt-get -y install software-properties-common git-core build-essential automake unzip python-dev python-setuptools && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN git clone https://github.com/facebook/watchman.git /tmp/watchman | |
WORKDIR /tmp/watchman | |
RUN ./autogen.sh | |
RUN ./configure |
typealias Reducer<StateType, ActionType> = (_ state: StateType, _ action: ActionType) -> StateType |
#!/usr/bin/env python3 | |
# Gambling Statistics Problem: | |
# If you play roulette every day and quit whenever you're ahead by x amount, | |
# do you make money in the long run? | |
# Answer: | |
# No. | |
import random | |
STARTING_BALANCE = 100000 |
func example() -> Single<String> { | |
let cache = MemoryCacheLevel() | |
.compose(DiskCacheLevel<GithubService, NSData>()) | |
.compose(MoyaFetcher(provider: provider)) | |
return cache.get(GithubService.zen) | |
.asObservable() | |
.map { data -> String in | |
guard let string = String(data: data as Data, encoding: .utf8) else { | |
throw MappingError.string(data) |
// | |
// Diffable.swift | |
// | |
// Created by danielgalasko on 8/5/17. | |
// | |
import Foundation | |
import IGListKit |
@Singleton | |
public class RealmManager { | |
private ThreadLocal<Realm> realms; | |
@Inject | |
public RealmManager() { | |
realms = new ThreadLocal<>(); | |
} | |
public Realm openRealm() { |
@Singleton | |
public class RealmManager { | |
private ThreadLocal<Realm> realms; | |
@Inject | |
public RealmManager() { | |
realms = new ThreadLocal<>(); | |
} | |
public Realm openRealm() { |
File > New > Project...
Create a Package.swift
file in your root project directory, add dependencies, then run swift package fetch
on the command line in the same directory. We’re not going to run swift build
because it will just complain.
// | |
// Activity.swift | |
// | |
// Created by Zachary Waldowski on 8/21/16. | |
// Copyright © 2016 Zachary Waldowski. Licensed under MIT. | |
// | |
import os.activity | |
private final class LegacyActivityContext { |