This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Main database location | |
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"<#(DatabaseNameAndType)#>"]; | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; | |
// The Build/Bundle Version number of the application on launch | |
NSString *versionNumber = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey]; | |
// Instead of using your app's bundle version create a custom key in your Info.plist for the database version. This is probably a better idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# Purpose: | |
# This script is for easily creating new websites with different boilerplates | |
# to minimize the amount of wasted time downloading and renaming files | |
# | |
# Installation: | |
# 1. Put this script somewhere permanent where you can call it from | |
# 2. In terminal run `chmod 755 newSite.rb` # Or whatever you name the script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# This is a simple script for printing out the methods in your Objective-C .h or .m file. | |
# It reads the passed file and stores just the method names in a text file | |
# | |
# Default filename and type for the file output | |
$DEFAULT_FILENAME = "out_file" | |
$DEFAULT_FILE_EXTENSION = "txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# => This script will authorize your Google credentials and download your Google Reader subscriptions | |
# => Usage: ./SCRIPTNAME GOOGLEUSERNAME PASSWORD | |
# | |
# The required networking shenanigans | |
require 'uri' | |
require 'net/http' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- By: @SmileyKeith | |
-- Vertically distributes your open finder windows for easy file movements | |
-- Thanks to @elasticthreads | |
tell application "Finder" | |
-- Get the number of Finder windows | |
set window_count to (count every Finder window) | |
-- Make sure there is an open Finder window | |
if window_count > 0 then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rake | |
require 'rubygems' | |
require 'fileutils' | |
# This requires the 'colorize' gem. Install with `[sudo] gem install colorize` | |
require 'colorize' | |
task :default => [:build] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# A tiny script to check available domain names | |
# Uses the Domai.nr API http://domai.nr/api/docs/json | |
# A blatent ripoff of http://blog.jerodsanto.net/2012/11/a-domainr-cli-in-less-than-15-lines-of-ruby/ | |
require 'rubygems' | |
require 'open-uri' | |
# `[sudo] install colorize json` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showHideMainWindow { | |
NSNumber *wasActive = @NO; | |
if ([[NSRunningApplication currentApplication] isActive]) { | |
wasActive = @YES; | |
NSNumber *wasOpen = @NO; | |
if ([self.window isVisible]) { | |
wasOpen = @YES; | |
[self.window close]; | |
[[NSApplication sharedApplication] hide:self]; | |
} else if (![wasOpen boolValue]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run argv | |
tell application "iTerm" | |
set t to make new terminal | |
tell t | |
activate current session | |
launch session "Default Session" | |
tell the last session | |
write text "cd \"" & item 1 of argv & "\"; clear; pwd" | |
end tell | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ([theEvent keyCode] == 38) { // j | |
unichar down = NSDownArrowFunctionKey; | |
NSString *downString = [NSString stringWithCharacters:&down length:1]; | |
NSEvent *newEvent =[NSEvent keyEventWithType:NSKeyDown | |
location:theEvent.locationInWindow | |
modifierFlags:theEvent.modifierFlags | |
timestamp:theEvent.timestamp | |
windowNumber:theEvent.windowNumber | |
context:nil | |
characters:downString |
OlderNewer