Skip to content

Instantly share code, notes, and snippets.

View opswhisperer's full-sized avatar
:octocat:
working . . .

Rob opswhisperer

:octocat:
working . . .
View GitHub Profile
@opswhisperer
opswhisperer / BranchSmartBanner.html
Last active December 30, 2015 08:47
Here's how you get the Branch smart banned to pull your ratings from the AppStore automatically. https://www.devilhornsoftware.com/blog/2015/12/30/a-smarter-smart-banner
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Branch.io Smart Banner</title>
<script type="text/javascript">
var ratingCount, averageUserRating, appID, branchKey;
appID = "284882215";
branchKey = "YOUR_API_KEY"
function getRating(content) {
@opswhisperer
opswhisperer / gist:14d8dbfb9f16dab8e1a8
Last active August 29, 2015 14:25
Creates a view that will slide out from under the table row when selected
import UIKit
class BasicTableViewController: UITableViewController {
var tableData = [String]()
var selectedCellIndexPath: NSIndexPath?
override func viewDidLoad() {
super.viewDidLoad()
for i in 1...100 {
@opswhisperer
opswhisperer / gist:1898af786db8eee732d6
Created May 26, 2015 03:02
save and load a Swift Dictionary to NSUserDefaults
//save dict to userDefaults
var data = NSKeyedArchiver.archivedDataWithRootObject(places)
NSUserDefaults.standardUserDefaults().setObject(data, forKey: "places")
//load
var data = NSUserDefaults.standardUserDefaults().objectForKey("places") as! NSData
places = NSKeyedUnarchiver.unarchiveObjectWithData(data) as! [Dictionary<String,String>]