How to Deploy a Rails App to DigitalOcean with Ubuntu 14.04, Phusion Passenger & Nginx, Postgres, and Capistrano
- Choose Server Image
- Choose Size (if this is a hobby app you can probably get away with the smallest)
| - (RACSignal *)rac_requestWithMethod:(NSString *)method path:(NSString *)path parameters:(id)parameters { | |
| return [[RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) { | |
| NSError *error; | |
| NSURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&error]; | |
| if (error) { | |
| [subscriber sendError:error]; | |
| return nil; | |
| } |
| post_install do |installer| | |
| app_plist = "Emergence/Info.plist" | |
| plist_buddy = "/usr/libexec/PlistBuddy" | |
| version = `#{plist_buddy} -c "Print CFBundleShortVersionString" #{app_plist}`.split | |
| puts "Updating CocoaPods' version numbers to #{version}" | |
| installer.pods_project.targets.each do |target| | |
| `#{plist_buddy} -c "Set CFBundleShortVersionString #{version}" "Pods/Target Support Files/#{target}/Info.plist"` | |
| end | |
| end |
| // | |
| // UIColor.swift | |
| // previously Color+HexAndCSSColorNames.swift | |
| // | |
| // Created by Norman Basham on 12/8/15. | |
| // Copyright ©2018 Black Labs. All rights reserved. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights |
| let styles: [UIFont.TextStyle] = [ | |
| // iOS 17 | |
| .extraLargeTitle, .extraLargeTitle2, | |
| // iOS 11 | |
| .largeTitle, | |
| // iOS 9 | |
| .title1, .title2, .title3, .callout, | |
| // iOS 7 | |
| .headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
| ] |
| . |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
| #import "FoundationLocks.h" | |
| #import "os/lock.h" | |
| @implementation LockableObject | |
| os_unfair_lock _lock; | |
| - (instancetype) init { | |
| After install zsh | |
| - brew update | |
| - brew install nvm | |
| - mkdir ~/.nvm | |
| after in your ~/.zshrc or in .bash_profile if your use bash shell: | |
| export NVM_DIR=~/.nvm | |
| source $(brew --prefix nvm)/nvm.sh |