This file contains hidden or 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
import Foundation | |
class ListDiffer<T: Equatable> { | |
private let beforeList: [T] | |
private let afterList: [T] | |
private let section: Int | |
private let elementComparison: ((T, T) -> Bool) | |
init(before: [T], after: [T], section: Int = 0, elementComparison: ((T, T) -> Bool) = { $0 == $1 }) { |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import UIKit | |
// Option 1 --------------------------- | |
protocol DescribeableClass { | |
static func className() -> String | |
} | |
extension DescribeableClass { |
This file contains hidden or 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
function prompt_command() { | |
highlight_non_zero_exit | |
PS1="\n${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " | |
} | |
function highlight_non_zero_exit() { | |
PASS=$? | |
if [[ $PASS != 0 ]]; then | |
printf "${echo_bold_red}> Exit status $PASS <${echo_reset_color}\n" | |
fi |
This file contains hidden or 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
import UIKit | |
class FirstViewController: UIViewController { | |
@IBOutlet weak var nextButton: UIButton! | |
@IBAction func didTapNextButton() { | |
performSegue(withIdentifier: "moveToSecondScreen", sender: nil) | |
} | |
} |
This file contains hidden or 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
module EnvironmentHelper | |
def with_environment(replacement_env) | |
original_env = ENV.to_hash | |
ENV.update(replacement_env) | |
yield | |
ensure | |
ENV.replace(original_env) | |
end | |
end |
This file contains hidden or 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
# Determine the feature list from the custom build URL in the source file, e.g.: | |
# Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load | |
has_features = [ | |
"fontface", | |
"backgroundsize", | |
"borderimage", | |
"borderradius", | |
"boxshadow", | |
"flexbox", |
This file contains hidden or 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
var SeedReporter = function(baseReporterDecorator) { | |
baseReporterDecorator(this); | |
this.onBrowserComplete = function(browser, result) { | |
if (result.order && result.order.random && result.order.seed) { | |
this.write("%s: Randomized with seed %s\n", browser, result.order.seed); | |
} | |
}; | |
}; |
This file contains hidden or 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
8.5 |
This file contains hidden or 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
#!/bin/sh | |
# Exit if any subcommand fails | |
set -e | |
# Install latest stable version of Chrome | |
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo dpkg -i google-chrome.deb | |
sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome | |
rm google-chrome.deb |
This file contains hidden or 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
#!/bin/sh | |
set -eu | |
failIfPresentInSpecs() { | |
REGEX=$1 | |
if find spec -type f -name "*_spec.rb" -exec grep -E "$REGEX" {} +; then | |
printf "\nFound focused specs\n" | |
exit 1 | |
fi |