(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#! /bin/sh | |
# On alternate invocations, this script | |
# saves the path of the source file currently open in Xcode | |
# and restores the file at that path in Xcode. | |
# | |
# By setting Xcode (in Behaviors) to run this script when "Run Starts" | |
# and when "Run Completes", you can prevent it from switching to main.m | |
# when a run finishes. | |
# See http://stackoverflow.com/questions/7682277/xcode-4-2-jumps-to-main-m-every-time-after-stopping-simulator |
1. Open terminal.app | |
2. Paste this command: defaults write NSGlobalDomain WebKitDeveloperExtras -bool true | |
(credit: https://twitter.com/defaultswrite/status/220164244954554368) | |
3. Open Rdio.app | |
4. Right click and show the inspector panel | |
5. In the console section, paste this line: $("head").append('<link href="https://s3.amazonaws.com/simon-dev/css/rdio.css" rel="stylesheet" type="text/css">') |
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
extension Array { | |
func first() -> Element? { | |
if isEmpty { | |
return nil | |
} | |
return self[0] | |
} | |
func last() -> Element? { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import Cocoa | |
var MAYBE: Bool { | |
get { | |
return Bool(Int(arc4random_uniform(2))) | |
} | |
} | |
var thisIsTotallyAGoodIdea = MAYBE |
#!/bin/bash | |
if [[ $BASH_SOURCE != $0 ]]; then echo "$BASH_SOURCE must be executed, not sourced."; return 255; fi | |
# | |
# A script to fool iOS playgrounds into allowing access to CommonCrypto | |
# | |
# The script creates a dummy CommonCrypto.framework in the SDK's System | |
# Framework Library Directory with a module map that points to the | |
# umbrella header | |
# | |
# Usage: |
Season's Greetings, NSHipsters!
As the year winds down, and we take a moment to reflect on our experiences over the past months, one thing is clear: 2014 has been an incredible year professionally for Apple developers. So much has happened in such a short timespan, and yet it's hard to remember our relationship to Objective-C before Swift, or what APIs could have captivated our imagination as much as iOS 8 or WatchKit.
It's an NSHipster tradition to ask you, dear readers, to send in your favorite tips and tricks from the past year for publication over the New Year's holiday. This year, with the deluge of new developments—both from Cupertino and the community at large—there should be no shortage of interesting tidbits to share.
Submit your favorite piece of Swift or Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!
If you're wondering about what to post, look to
#import <Foundation/Foundation.h> | |
/* | |
clang --analyze readonly-property-analyzer.m | |
readonly-property-analyzer.m:20:2: warning: Incorrect decrement of the reference count of an object that is not owned at this point by the caller | |
[_string release]; | |
^~~~~~~~~~~~~~~~~ | |
1 warning generated. |