Skip to content

Instantly share code, notes, and snippets.

View wtsnz's full-sized avatar
🛠️
Working

Will Townsend wtsnz

🛠️
Working
View GitHub Profile
@wtsnz
wtsnz / .gitignore
Created October 21, 2013 08:25
Xcode 5 .gitignore
# Xcode Crap
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata
# OS Crap
.DS_Store
@wtsnz
wtsnz / gist:8379211
Created January 12, 2014 01:10
Add subl to OSX Terminal Usage open sublime text with the current directory "subl ." open sublime text with the specified directory "subl /path/to/directory" open file in sublime text "subl /path/to/file.txt"
cd ~
mkdir bin
echo "export PATH=~/bin:$PATH" >> ~/.profile
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
@wtsnz
wtsnz / _service.md
Last active March 19, 2016 04:31 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@wtsnz
wtsnz / lines.sh
Last active July 27, 2016 02:26
Find the amount of lines of code in your iOS Project.Run this in the root project folder
Obj-c
find . -iname "*.m" -o -iname "*.h" -not -path "*/Pods/*" -not -path "*ThirdParty*" -exec wc -l '{}' +
Swift:
find . -iname "*.swift" -not -path "*/Pods/*" -not -path "*/Carthage/*" -not -path "*submodules*" -exec wc -l '{}' +
@wtsnz
wtsnz / delazy.js
Last active August 2, 2016 22:17
Super hacky script to delazy your swift files to decrease compile time.
//
// Hacky script to convert lazy loaded closures into private instance functions
// The script ignores Pods, Carthage and build folders, and only looks for
// .swift files
// This doesn't work on all cases, and may break things. Be warned ⚠️
//
// Usage:
// node delazy.js <folder path>
//

This is what I did to install all apps onto laptop

Software

  • Chrome
  • iTerm
  • Dropbox
  • Atom
  • Spotify
  • Tweetbot
@wtsnz
wtsnz / index.js
Created February 18, 2017 00:57
Fabric to Pushover: New Users
var Pushover = require('node-pushover');
var moment = require('moment');
var request = require('request');
// Fill out with your secrets
var secrets = {
pushover: {
token: '',
user: ''
},
@wtsnz
wtsnz / UIImage+InCurrentBundle.swift
Created May 8, 2017 01:17
Load a UIImage from an xcassets library in your framework.
extension UIImage {
convenience init?(inCurrentBundleNamed: String) {
class BundleClass { }
self.init(named: inCurrentBundleNamed, in: Bundle(for: BundleClass.self), compatibleWith: nil)
}
}
@wtsnz
wtsnz / buildMobileVLC.sh
Created September 27, 2015 12:57 — forked from fbradyirl/buildMobileVLC.sh
Modified to build tvOS framework. run with ./buildMobileVLCKit.sh -t -f
#!/bin/sh
# Copyright (C) Pierre d'Herbemont, 2010
# Copyright (C) Felix Paul Kühne, 2012-2015
set -e
BUILD_DEVICE=yes
BUILD_SIMULATOR=yes
BUILD_STATIC_FRAMEWORK=no
SDK=`xcrun --sdk iphoneos --show-sdk-version`
@wtsnz
wtsnz / ExternalInterface.cpp
Created September 11, 2011 22:37
HaXe NME Vibrate for WebOS
// --- vibrateDevice---------------
value nme_vibrate_device()
{
#ifdef WEBOS
VibrateDevice();
return alloc_null(true);
#enif
}
DEFINE_PRIM(nme_vibrate_device,0);