One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| public extension CustomDebugStringConvertible { | |
| var debugDescription: String { | |
| return debugDescription() | |
| } | |
| func debugDescription(_ indentationLevel: Int = 0, includeType: Bool = true) -> String { | |
| let indentString = (0..<indentationLevel).reduce("") { tabs, _ in tabs + "\t" } | |
| var s: String |
| #!/usr/bin/env ruby | |
| require 'JSON' | |
| device_types = JSON.parse `xcrun simctl list -j devicetypes` | |
| runtimes = JSON.parse `xcrun simctl list -j runtimes` | |
| devices = JSON.parse `xcrun simctl list -j devices` | |
| devices['devices'].each do |runtime, runtime_devices| | |
| runtime_devices.each do |device| |
| func exponentialMovingAverage(currentAverage: Double, newValue: Double, smoothing: Double) -> Double { | |
| return smoothing * newValue + (1 - smoothing) * currentAverage | |
| } | |
| // Usage: | |
| // var a = 3 | |
| // a = exponentialMovingAverage(a, 8, 0.5) | |
| // Swift 2 |
I was playing with GitHub Archive recently. Out of curiosity I ran this query:
SELECT COUNT(repository_owner) as totalStars, repository_owner
FROM [githubarchive:github.timeline]
WHERE type = 'WatchEvent'
GROUP BY repository_owner
ORDER BY totalStars DESC
LIMIT 1000| #!/usr/bin/env ruby | |
| device_types_output = `xcrun simctl list devicetypes` | |
| device_types = device_types_output.scan /(.*) \((.*)\)/ | |
| runtimes_output = `xcrun simctl list runtimes` | |
| runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/ | |
| devices_output = `xcrun simctl list devices` | |
| devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/ |
| #!/bin/bash | |
| ############################################################################ | |
| # Automated WWDC 2014 videos downloader script | |
| # Cristian Grau @SaroFR | |
| # Based on Krzysztof Zablocki's (@merowing_) Download HD WWDC 2014 command | |
| ############################################################################ | |
| function download { | |
| curl --silent --remote-name $1 |
layout: post title: "ReactiveCocoa Unit Testing Tips" date: 2013-09-22 20:45 comments: true categories:
I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)