Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am litso on github.
* I am litso (https://keybase.io/litso) on keybase.
* I have a public key ASAS-BE5_2G8lT3amKja5DoDEk3bf2kHCy5VVMkk52cIxgo
To claim this, I am signing this object:
protocol Identifiable {
var x: String { get }
}
class Taco: Identifiable {
let x: String
init() {
self.x = "taco"
}
# Fastlane extension to increment build number
# Designed for build setup where you are manually triggering beta builds from the master branch.
# Uses Apple's agvtool to increment and commits the resulting changes.
# Necessary because Fastlane's built in action does not commit the result.
module Fastlane
module Actions
module SharedValues
INCREMENT_AND_COMMIT_BUILD_NO_CUSTOM_VALUE = :INCREMENT_AND_COMMIT_BUILD_NO_CUSTOM_VALUE
end
@litso
litso / is-testflight.m
Last active August 29, 2015 14:14
Detect whether it’s running on a TestFlight build
// Source: http://blog.supertop.co/post/108759935377/app-developer-friends-try-testflight
// Here’s a little tip I picked up from Paul Haddad on Twitter.
// If you want your app to detect whether it’s running on a TestFlight build, this should do the trick:
[[[[NSBundle mainBundle] appStoreReceiptURL] lastPathComponent] isEqualToString:@"sandboxReceipt”]
@litso
litso / swift-constant-conditional
Created August 22, 2014 21:20
Assign constant based on conditional
import UIKit
let determinesValue = true
// Problem: I want to assign to `mySize` based on value of `determinesValue`
// without nesting e.g. if (determinesValue) { let mySize = ...
// Method 1: Use a trigraph
// drawbacks: Not good if you need compare multiple values
let mySize1 = determinesValue ? 20 : 10
#!/bin/bash
#
### CocoaPods git-checkout hook
#
# This is a hook which you can install, it will automatically
# run `pod install` when you do a git pull/clone/checkout.
#
# The hook can be used to make CocoaPods usable with Xcode CI.
#
## Installation
var page = require('webpage').create();
// User-Agent is supported through page.settings
page.settings.userAgent = 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25';
// This is how you set other header variables
page.customHeaders = {'Referer': 'localhost'};
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}