Skip to content

Instantly share code, notes, and snippets.

View wbroek's full-sized avatar

Wouter van den Broek wbroek

View GitHub Profile
@wbroek
wbroek / Podfile
Created December 16, 2016 15:53
Set swift target for Cocoapods
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
// TextView subclass that replicates TVOS movies app
// Also made a quick presentation controller
// Just connect the delegate to the ViewController in IB
// and set the TextView class to FocusTextView
import UIKit
class TextPresentationViewController:UIViewController {
let label = UILabel()
let blurStyle = UIBlurEffectStyle.Dark
@wbroek
wbroek / .htaccess
Last active April 18, 2017 14:34 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@wbroek
wbroek / importcert.sh
Created June 2, 2015 09:15
Convert cert key to bks for Android SSL Pinning
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "Usage: importcert.sh <CA cert PEM file> <bouncy castle jar> <keystore pass>"
exit 1
fi
CACERT=$1
BCJAR=$2
SECRET=$3
@wbroek
wbroek / install.sh
Last active August 29, 2015 14:06 — forked from stayallive/install.sh
#!/bin/bash
# Make sure you are up to date
yum -y update && yum -y install wget
# Install EPEL repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Get us a clean working directory
mkdir /php
@wbroek
wbroek / keybase.md
Created September 23, 2014 07:07
keybase.md

Keybase proof

I hereby claim:

  • I am wbroek on github.
  • I am wbroek (https://keybase.io/wbroek) on keybase.
  • I have a public key whose fingerprint is F07A 7340 1D50 630A 4A6A 1482 DE92 4678 7C81 6CB0

To claim this, I am signing this object:

@wbroek
wbroek / update_xcode_plugins
Last active August 29, 2015 14:06 — forked from neonichu/update_xcode_plugins
Make Xcode plugins compatible with latest Xcode installed on system (Xcode 6 atm)
#!/bin/sh
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
"$1/Contents/Info.plist"
}
function has_compatibility() {
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end
@wbroek
wbroek / gist:3818598
Created October 2, 2012 12:20
iOS 6 open Maps with route
Class MKMapItemClass = [MKMapItem class];
if (MKMapItemClass && [MKMapItemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) {
CLLocationCoordinate2D endCoord = { 54.0696, 50.3616 };
MKPlacemark *endLocation = [[MKPlacemark alloc] initWithCoordinate:endCoord addressDictionary:nil];
MKMapItem *endingItem = [[MKMapItem alloc] initWithPlacemark:endLocation];
NSMutableDictionary *launchOptions = [[NSMutableDictionary alloc] init];
[launchOptions setObject:MKLaunchOptionsDirectionsModeDriving forKey:MKLaunchOptionsDirectionsModeKey];