Skip to content

Instantly share code, notes, and snippets.

View jkubicek's full-sized avatar

Jim Kubicek jkubicek

View GitHub Profile
@jkubicek
jkubicek / gist:9075340
Created February 18, 2014 17:17
My mogenerator rake task
desc 'Use Mogenerator to create Core Data models'
task :mogen do
`which mogenerator`
unless $?.success?
fail "This project requires mogenerator. See installation instructions"\
" at http://rentzsch.github.io/mogenerator/"
end
cmd = "mogenerator --template-var arc=true "\
"--model My_Project/Model.xcdatamodeld/Model.xcdatamodel/ "\
"--output-dir My_Project/Model/"
tell application "iPhone Simulator"
activate
end tell
tell application "System Events"
tell process "iPhone Simulator"
click menu item "Reset Content and Settings…" of menu "iOS Simulator" of menu bar 1
delay 0.25
key code 76 -- The return button
end tell
@jkubicek
jkubicek / birds.txt
Last active August 29, 2015 14:02
Print the names of all the birds
Striated Pardalote
Elegant Crested Tinamou
Little Tinamou
Slaty-breasted Tinamou
Thicket Tinamou
Great Tinamou
Chilean Tinamou
Cinereous Tinamou
Brown Tinamou
Greater Rhea
@jkubicek
jkubicek / keybase.md
Created December 16, 2014 21:50
Keybase Validation

Keybase proof

I hereby claim:

  • I am jkubicek on github.
  • I am jkubicek (https://keybase.io/jkubicek) on keybase.
  • I have a public key whose fingerprint is 7E94 5E4C 38D6 0CE5 C3AE 7AA6 6D5A 35E1 86AF D4A5

To claim this, I am signing this object:

@jkubicek
jkubicek / gist:fe2dbc7ad583ffacf2b6
Last active August 29, 2015 14:12
Swift nil-check compound assignment operator.
infix operator ??= {}
func ??=<T>(inout optional: T?, value: T) {
if optional == nil {
optional = value
}
}
var id: Int? = nil
@jkubicek
jkubicek / NSManagedObject.swift
Created July 2, 2015 04:45
managed object creation extension
protocol ManagedObject {
static var entityName: String { get }
}
extension ManagedObject where Self: NSManagedObject {
static func createWithContext(context: NSManagedObjectContext) -> Self {
return Self.createWithContext(context, entityName: self.entityName)
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
@jkubicek
jkubicek / Numbers Current Time.scpt
Created April 8, 2011 23:22
Paste the current time into the currently selected Numbers.app cell
tell application "Numbers"
set current_cell to cell 0 of selection range of table 0 of sheet 0 of document 0
set value of current_cell to (current date) as string
end tell
@jkubicek
jkubicek / AdHoc_Deployment.sh
Created April 19, 2011 10:59
Bash script to automate app deployment. Sets the updates the version numbers, sets a tag in git
#!/bin/sh
# AdHocDeployment.sh
# Newsgroup
#
# Created by Jim Kubicek on 4/1/11.
# Copyright 2011 jimkubicek.com. All rights reserved.
# Update version number
agvtool next-version -all