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 / fix-diffmerge.applescript
Last active December 12, 2018 00:47
Sometimes after using DiffMerge with multiple monitor setups, it's positioned way up above the OSX menu bar and I'm unable to see the entire window. This small Apple Script snippet rescues me.
tell application "System Events" to tell application process "DiffMerge"
tell window 1
set {size, position} to {{400, 400}, {50, 50}}
end tell
end tell
@wtsnz
wtsnz / blue-cube.dae
Last active October 25, 2018 18:37
An example Collada file
<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>SceneKit Collada Exporter v1.0</authoring_tool>
</contributor>
<created>2018-10-25T16:29:03Z</created>
<modified>2018-10-25T16:29:03Z</modified>
<unit meter="1.000000"/>
<up_axis>Y_UP</up_axis>
@wtsnz
wtsnz / cube.dae
Created October 25, 2018 18:36
An example Collada file
<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>SceneKit Collada Exporter v1.0</authoring_tool>
</contributor>
<created>2018-10-25T16:29:03Z</created>
<modified>2018-10-25T16:29:03Z</modified>
<unit meter="1.000000"/>
<up_axis>Y_UP</up_axis>
@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);
@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 / 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 / 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: ''
},

This is what I did to install all apps onto laptop

Software

  • Chrome
  • iTerm
  • Dropbox
  • Atom
  • Spotify
  • Tweetbot
@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>
//
@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 '{}' +