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 / 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 / gist:5712546
Created June 5, 2013 08:46
Install Node.JS on Amazon Linux
# Update the system
sudo yum update
# Install gcc, make, openssl, git
sudo yum install gcc-c++ make
sudo yum install openssl-devel
sudo yum install git
# Clone the git repo and build
git clone git://github.com/joyent/node.git
@wtsnz
wtsnz / gist:5726768
Created June 7, 2013 02:51
Automatic iOS Deployments Bash Script
#!/bin/bash
cd /Shared\ Items/Public/AUTO/project
BUILDDIR="/Shared Items/Public/AUTO/project_build"
NAME="Project"
CONFIGURATION="Ad Hoc"
API_TOKEN="..."
TEAM_TOKEN="..."
@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 / 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 / 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
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...)
#endif
#ifdef DEBUG
# define ULog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
#else
# define ULog(...)
#endif
@wtsnz
wtsnz / animated.m
Last active August 29, 2015 13:57
Implementing Animated:(BOOL)animated
- (void)hideAdBannerViewAnimated:(BOOL)animated
{
void (^animations)() = ^void() {
CGRect addBannerViewFrame = self.adBannerView.frame;
addBannerViewFrame.origin.y = self.view.frame.size.height;
self.adBannerView.frame = addBannerViewFrame;
};
if (animated) {
[UIView animateWithDuration:0.3 delay:0.0 usingSpringWithDamping:1.0 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:animations completion:nil];

This is what I did to install all apps onto laptop

Software

  • Chrome
  • iTerm
  • Dropbox
  • Atom
  • Spotify
  • Tweetbot
@wtsnz
wtsnz / gist:57f649e096778b35701f
Created November 17, 2014 11:27
Print out font families
NSArray *fontFamilies = [UIFont familyNames];
for (int i = 0; i < [fontFamilies count]; i++)
{
NSString *fontFamily = [fontFamilies objectAtIndex:i];
NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
NSLog (@"%@: %@", fontFamily, fontNames);
}