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.
| The MIT License (MIT) | |
| Copyright (c) 2016 Zev Eisenberg | |
| 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 to | |
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| the Software, and to permit persons to whom the Software is furnished to do so, | |
| subject to the following conditions: |
| 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: