This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Turn on Location Services? | |
[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]]; | |
// Set up Twitter? | |
[NSURL URLWithString:@"prefs:root=TWITTER"]]; | |
// Hook up a Bluetooth device? | |
[NSURL URLWithString:@"prefs:root=General&path=Bluetooth"]]; | |
// Change app settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copied, Pasted and summarized from ps' source code. | |
You can use sysctl to get other process' argv. | |
*/ | |
#include <sys/sysctl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define pid_of(pproc) pproc->kp_proc.p_pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# (Above line comes out when placing in Xcode scheme) | |
# | |
# Inspired by original script by incanus: | |
# https://gist.github.com/1186990 | |
# | |
# Rewritten by martijnthe: | |
# https://gist.github.com/1379127 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGFloat BNRTimeBlock (void (^block)(void)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
kAccomplishmentTitleSection = 0, | |
kAccomplishmentCategorySection, | |
kNumberOfSections | |
} NESTemplateEditTableSections; | |
static NSString * const kCellIdentifiers[] = { | |
[kAccomplishmentTitleSection] = @"AccomplishmentTitleCell", | |
[kAccomplishmentCategorySection] = @"AccomplishmentCategoryCell" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OLD: | |
FMDatabase *db = [FMDatabase databaseWithPath:dbPath]; | |
… | |
[db executeUpdate:@"insert into namedparamtest values (:a, :b, :c, :d)" withParameterDictionary:dictionaryArgs]; | |
NEW: | |
FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:dbPath]; | |
… | |
[queue inDatabase:^(FMDatabase *db) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'oauth' | |
require 'yaml' | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
def get_access_token | |
p "get_access_token: Initializing Consumer" | |
consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>App Redirection</title> | |
</head> | |
<body> | |
<!-- iframe used for attempting to load a custom protocol --> | |
<iframe style="display:none" height="0" width="0" id="loader"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doesAppExist() { | |
// try to open iOS application | |
document.location = 'customiosappurl://'; | |
// if above failed, nothing happened | |
// set a timeout and do something else | |
!window.document.webkitHidden && setTimeout(function() { | |
setTimeout(function() { | |
window.location = '//apple.itunes.com/whatever' | |
}, 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
// | |
// Permission is hereby granted, free of charge, to any person |
OlderNewer