Skip to content

Instantly share code, notes, and snippets.

View timonus's full-sized avatar

Tim Johnsen timonus

View GitHub Profile
@timonus
timonus / flipboard-ios-api.md
Created November 7, 2013 17:33
Flipboard iOS x-callback-url Support

Flipboard iOS x-callback-url Support

As of Flipboard for iOS 2.1, Flipboard supports the x-callback-url protocol for some actions.

Added in Flipboard 2.1 (URL scheme flip-api-v1)

You can use the scheme flip-api-v1 or flipboard-x-callback with action flip to launch the app and open our UI for flipping items into user magazines.

@timonus
timonus / flipboard-native-bookmarklet
Last active August 29, 2015 14:05
Flipboard Native Bookmarklet
// This is a bookmarklet that launches Flipboard and allows you to save to one of your magazines
// Note: We also have a dedicated web bookmarklet available at https://share.flipboard.com/
// Steps to install
// 1. Open Safari and save any page to your bookmarks
// 2. Edit the bookmark you made and paste in the following Javascript in the URL field
javascript:var url=encodeURIComponent(window.location);window.location='flip-api-v1://x-callback-url/flip?url='+url+'&x-success='+url+'&x-cancel='+url+'&x-error='+url;
// Here's a video of how it's done https://www.dropbox.com/s/lhfcxk2jcvkr5eq/flipboard-native-bookmarklet.mov
@timonus
timonus / bookmarklets
Last active August 29, 2015 14:05
Bookmarklets
Open Tweet in Tweetbot:
javascript:var url = window.location;var tweetRegex = new RegExp('https?://(www.|mobile.)?twitter.com/.*/status/([0-9]{18})(/.*)?');var tweetIdentifier = url.match(tweetRegex)[2];window.location='tweetbot:///status/' + tweetIdentifier;
@timonus
timonus / visualize-ipa.py
Last active July 24, 2016 20:14
.ipa Visualizer
import sys
import subprocess
import re
import os
import shutil
if len(sys.argv) < 2:
print "No path specified"
sys.exit()
@timonus
timonus / class-hierarchy.py
Created January 16, 2015 00:43
Class Hierarchy Visualizer
import sys
import subprocess
import re
import os
import shutil
import json
# usage
# python class-hierarchy.py *directory to scan within*
# outputs nested json
@timonus
timonus / kill.rb
Created August 20, 2015 20:34
Deletes all yer iOS simulators
#!/usr/bin/env ruby
device_types_output = `xcrun simctl list devicetypes`
device_types = device_types_output.scan /(.*) \((.*)\)/
runtimes_output = `xcrun simctl list runtimes`
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/
devices_output = `xcrun simctl list devices`
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/
@timonus
timonus / TJLogoView.h
Created September 10, 2015 02:59
tijo Logo Objective-C Source
//
// TJLogoView.h
// Logo
//
// Created by Tim Johnsen on 9/7/15.
// Copyright (c) 2015 tijo. All rights reserved.
//
#import <UIKit/UIKit.h>
@timonus
timonus / UIWindow+AppSwitchScrollStopper.h
Last active January 6, 2017 19:01
AppSwitchScrollStopper
// UIWindow+AppSwitchScrollStopper.h
// Created by Tim Johnsen on 3/27/16.
#import <UIKit/UIKit.h>
@interface UIWindow (AppSwitchScrollStopper)
/// Call this early on in your app's lifecycle to avoid
/// scroll-related flashing when your app resumes from the background
- (void)installAppSwitchScrollStopper;
//
// UITraitCollection+DarknessCompatibility.h
// Tangent
//
// Created by Tim Johnsen on 6/25/16.
// Copyright © 2016 tijo. All rights reserved.
//
#import <UIKit/UIKit.h>
@timonus
timonus / bookmarklet.js
Created June 21, 2017 18:30
Redirector Bookmarklet
// This redirects to a page that contains a link to the page currently being viewed, which can be useful for debugging things.
// Instructions: Create a bookmark then edit its address to be this.
// Video: https://db.tt/DaXP7t66KN
javascript:location.href='https://u121985.dl.dropboxusercontent.com/u/121985/redirect-link.html?url='+encodeURIComponent(location.href);