Skip to content

Instantly share code, notes, and snippets.

import struct Module . Module . Symbol @ available ( iOS 1 , * ) @ objc class Class < A , B > : Base where A : Protocol , B : Protocol { typealias Some = Type let variable : ( Double? , a : T ) = 1.3 let arr = [ 1 , 2 ] as [ Int ]! let dict = ["1" : 2 ,"3" : 4 ] private ( set ) var variable : Type { get { } set ( param ) { } } init ( ) { super . init( ) } func fun < A , B > ( a : A , b : ( B , String ) -> Void ) throws { await call( ) & foo = 1 + 2 ? 3 : 4 self [ \ . foo . bar ] = true as Type if #available ( iOS 1 , * ) , case . some( let b ) = c { continue } guard test is T , let a = b , c != nil else { return } do { switch try? foo( ) { case 1 , 2 : break default : throw Error . fatal } } catch let e1 as Err { } catch { } foo . baz . bar( a : 1 , b : 2 , c : 3 ) { [ a = b , unowned ( safe ) self ] a , b in a ; b c } more : { _ in } var ( _ , s ) = ( bar : 1 , baz : [ 3 , 4 ] ) _ = { ( a : A , b : B ) -> C in a ; b c } defer { f ; b } switch a { case is B : fallthrough case let t as T : break } for item i
set nosmoothscroll
let scrollstep = 100
let homeurl = "about://"
let newtaburl = "about://"
let blacklists = ["https://mail.google.com/*","https://www.youtube.com/*","https://github.com/notifications*"]
tell application "Xcode"
set CurrentDocument to document 1 whose name ends with (get name of front window)
set FilePath to path of CurrentDocument
set {start, _} to selected paragraph range of CurrentDocument
tell application "Terminal"
do script "FILE=\"" & FilePath & "\"; cd \"$(dirname \"$FILE\")\"; cd \"$(git rev-parse --show-toplevel)\"; tig blame +" & start & " \"$FILE\""
activate
end tell
.sVim-hint {
background-color: #FFC542;
color: #000;
font-size: 12px;
font-family: Helvetica;
font-weight: bold;
padding: 1px 3px 0px;
border-radius: 3px;
opacity: 1;
}
#!/bin/bash
# Enables full/split-screen window modes in the running Simulator.app instance
# (original idea: https://twitter.com/stroughtonsmith/status/799664540996739073)
#
# Works by attaching with LLDB to the running Simulator.app instance and
# adding -Primary, -Auxiliary and -AllowsTiling collectionBehavior's to existing windows.
# Note that this is usually impossible due to SIP (System Integrity Protection). One
# workaround is to remove code signature from the Simulator binary.
#
@odnoletkov
odnoletkov / lastsim.sh
Created July 31, 2015 18:22
Lookup sandbox directory of the most recently launched application in iOS Simulator
#!/bin/sh
device_file=$(find ~/Library/Developer/CoreSimulator/Devices/*/data/var/run/launchd_bootstrap.plist -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -n 1 | cut -d " " -f 2-)
device=${device_file%/*/*/*}
#echo $device
app_caches=$(find ${device}/Containers/Data/Application/*/Library/Caches -d 0 -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -n 1 | cut -d " " -f 2-)
#echo $app_caches
app=${app_caches%/*/*}