Skip to content

Instantly share code, notes, and snippets.

@sibljon
sibljon / states_hash.json
Created October 10, 2017 22:03 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {
let url = navigationAction.request.URL?.absoluteString
let hostAddress = navigationAction.request.URL?.host
// To connnect app store
if hostAddress == "itunes.apple.com" {
if UIApplication.sharedApplication().canOpenURL(navigationAction.request.URL!) {
@sibljon
sibljon / pre-push.sh
Last active September 18, 2015 17:17 — forked from lyoshenka/pre-push.sh
Git pre-push hook to prevent force-pushing or deleting a special branch (e.g. master)
#!/bin/bash
# Requires git 1.8.2 or newer
# Prevents force-pushing or deleting a special branch (e.g. master).
# Based on: https://gist.github.com/pixelhandler/5718585 and https://gist.github.com/stefansundin/d465f1e331fc5c632088
# Install:
# cd path/to/git/repo
# curl -fL -o .git/hooks/pre-push https://gist.githubusercontent.com/lyoshenka/158cfff41d09e1dcf029/raw/pre-push.sh
# chmod +x .git/hooks/pre-push
#import <UIKit/UIKit.h>
@interface IntrinsicTableView : UITableView
@end
#!/bin/sh
# name this .git/hooks/pre-commit
# chmod +x .git/hooks/pre-commit
# enjoy
# so it will work on empty repos
if git-rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904