This file contains 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
class API { | |
func obtainIds() -> Observable<[Int]> { | |
return .just([1,2,3,4]) | |
} | |
} | |
class ViewModel { | |
let update: AnyObserver<Void> | |
let dataUpdated: Observable<[String]> |
This file contains 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
@interface NSObject (Debounce) | |
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay; | |
@end |
This file contains 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
private enum ListNode<Element> { | |
case End | |
indirect case Node(Element, next: ListNode<Element>) | |
func cons(x: Element) -> ListNode<Element> { | |
return .Node(x, next: self) | |
} | |
} | |
public struct ListIndex<Element> { |
This file contains 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
protocol NonemptyCollection: Collection { | |
var first: Iterator.Element { get } | |
} | |
enum NonemptyIndex<Base: Collection>: Comparable { | |
case head | |
case tail(Base.Index) | |
static func ==(lhs: NonemptyIndex, rhs: NonemptyIndex) -> Bool { | |
switch (lhs,rhs) { |
This file contains 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
Math.atan(1)*4 |
This file contains 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "mutter" | |
require "httparty" | |
REMOTE = "origin" | |
REPO = `git config --get remote.#{REMOTE}.url`.chomp[/github\.com[\/\:]([^\/]+\/[^\/]+)\.git/, 1] | |
USER = `git config --get github.user`.chomp | |
TOKEN = `git config --get github.token`.chomp |
This file contains 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
require "rubygems" | |
require "net/http" | |
require "uri" | |
require "aws/s3" | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'ACCESS KEY', | |
:secret_access_key => 'SECRET KEY' | |
) |
This file contains 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
#!/usr/bin/python | |
# Program to convert a number into the format | |
# hh mm ss.sssss | |
# Input format: ./converter.py DEC RA | |
import math | |
import sys | |
import string | |
def to_dec(inp): |