Skip to content

Instantly share code, notes, and snippets.

View budidino's full-sized avatar

Dino Budimilić budidino

View GitHub Profile
// Some of the things I use in my projects
import UIKit
let sharedApp = UIApplication.shared
let noteCenter = NotificationCenter.default
let userDefaults = UserDefaults.standard
func assertOnMain() { assert(Thread.isMainThread) }
func assertOffMain() { assert(!Thread.isMainThread) }
func assertFail() { assert(false) }
// example to help out someone on stackoverflow
// http://stackoverflow.com/questions/12916539/simplest-php-example-for-retrieving-user-timeline-with-twitter-api-version-1-1/16169848?noredirect=1#comment34312649_16169848
// get the array of tweets
$tweets = returnTweet();
// loop all the tweets and display each of them
foreach($tweets as $tweet){
echo "Tweet: " . $tweet["text"] . "<br>";
}