Skip to content

Instantly share code, notes, and snippets.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1
@nanoxd
nanoxd / fry.rb
Last active August 29, 2015 14:01
Fry, a ruby version manager for Fish
require "formula"
class Fry < Formula
homepage 'https://github.com/terlar/fry'
url 'https://github.com/terlar/fry/archive/0.1.2.tar.gz'
sha1 'b44340ff94689af0699485432189dff87730c619'
head 'https://github.com/terlar/fry.git'
depends_on 'fish'
@nanoxd
nanoxd / ViewController.swift
Last active December 5, 2017 01:13
Setup UIRefreshControl
lazy var refreshControl: UIRefreshControl = {
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: "handleRefresh:", forControlEvents: UIControlEvents.ValueChanged)
return refreshControl
}()
@objc func handleRefresh() {
}

Keybase proof

I hereby claim:

  • I am nanoxd on github.
  • I am nanoxd (https://keybase.io/nanoxd) on keybase.
  • I have a public key ASCyQEMSeoe49Rf__mhySgR6vtqbCMGKgYPikQt0ZLLC9go

To claim this, I am signing this object:

@nanoxd
nanoxd / wercker.yml
Last active March 2, 2017 18:05
Wercker with Yarn
box: node
build:
steps:
- script:
name: Setup Yarn Caching
code: export YARN_CACHE=$WERCKER_CACHE_DIR/yarn
- script:
name: Yarn Install
code: HOME=$YARN_CACHE yarn --no-progress
- script:
@nanoxd
nanoxd / git-sweep
Last active April 28, 2017 20:41
Clean up branches
#!/bin/bash
# git-sweep
# Cleans up branches on Origin and verifies that they have already been merged
# USAGE: git sweep
# This must be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
@nanoxd
nanoxd / mobile_ci.md
Last active February 15, 2018 14:29
Mobile CI Tryouts

App Center

Pros

  • Easy setup
  • Multitude of different tools included by default
  • Team Management
  • Webhooks
  • Extensible via clones
  • Fast start on builds
@nanoxd
nanoxd / UIButton+Rx.swift
Last active September 22, 2018 16:47
[UIButton+IsCheckedRx] Adds checked behavior to UIButton #uikit #swift
extension Reactive where Base: UIButton {
/// Alternated with button taps to provide
/// a checkbox behavior by `UIButton`
var checked: ControlProperty<Bool> {
let button = self.base
let source: Observable<Bool> = self.tap
.map {[weak button] in
guard let state = button?.isSelected else {
return false
}
@nanoxd
nanoxd / ch-init
Created June 27, 2018 19:59
Clubhouse-Git integration
#!/usr/bin/env sh
#/ Usage: ch-init 123
# Initializes the current branch to a ticket
if [ $# = "0" ]; then
printf 'usage: ch-init <ticket>\n'
exit 1
fi
TICKET="$@"