Skip to content

Instantly share code, notes, and snippets.

View dnlcrl's full-sized avatar

dnlcrl

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dnlcrl
dnlcrl / Array Masking.swift
Created January 27, 2016 10:06 — forked from JadenGeller/Array Masking.swift
Swift Array Masking Operations
// Example
var x = [1, 2, 3, 4, 5] // [1, 2, 3, 4, 5]
var y = [1, 1, 2, 3, 5] // [1, 1, 2, 3, 5]
var z = x - y // [0, 1, 1, 1, 0]
x[ x % 2 != 0 ] = x + 1 // [2, 2, 4, 4, 6]
y[ y > 2 * z ] = y * y // [1, 1, 2, 9, 25]
z[ x > 2 && x < 6 ] = 0 // [0, 1, 0, 0, 0]
@dnlcrl
dnlcrl / xibtonib.sh
Last active December 13, 2021 11:11 — forked from ssp/xibtonib.sh
Convert .xib files to .nib files
#! /bin/sh
find . -name "*.xib" -type f | awk '{sub(/.xib/,"");print}' | xargs -I % ibtool --compile %.nib %.xib