Skip to content

Instantly share code, notes, and snippets.

View shazron's full-sized avatar
😆

Shazron Abdullah shazron

😆
View GitHub Profile
// PhoneGap Reachability Support
function testReachable() {
// no http:// prefix!
navigator.network.isReachable("www.google.com", testReachable_callback);
// OR by ipAddress
navigator.network.isReachable("212.32.454.32", testReachable_callback, { isIpAddress: true});
}
// NetworkStatus: 0 for NotReachable, 1 for ReachableViaCarrierDataNetwork,
function watchCompass() {
debug.log("watchCompass");
var suc = function(a){
document.getElementById('compass_magnetic').innerHTML = roundNumber(a.magneticHeading);
document.getElementById('compass_true').innerHTML = roundNumber(a.trueHeading);
document.getElementById('compass_accuracy').innerHTML = roundNumber(a.headingAccuracy);
};
var fail = function(){};
var opt = {};
opt.frequency = 100;
<Fri Nov 06 - 08:29:47> <elliottcable - Sophie-2> <~/Downloads/>
$ xattr /Users/elliottcable/Downloads/GitX.app
com.apple.quarantine
<Fri Nov 06 - 08:29:48> <elliottcable - Sophie-2> <~/Downloads/>
$ xattr -p com.apple.quarantine /Users/elliottcable/Downloads/GitX.app
0000;4af45c3f;WebKit;|org.webkit.nightly.WebKit
From PrivateFrameworks/Bom.framework:
U _BOMCopierCopyWithOptions
U _BOMCopierCountFilesInArchive
U _BOMCopierFree
U _BOMCopierNew
U _BOMCopierSetCopyFileFinishedHandler
U _BOMCopierSetCopyFileStartedHandler
U _BOMCopierSetCopyFileUpdateHandler
U _BOMCopierSetFatalErrorHandler
U _BOMCopierSetFatalFileErrorHandler
@shazron
shazron / gist:943736
Created April 27, 2011 04:55
About XCode 4 Project Template (How To Create Custom Project Template)
From: http://snipt.net/yonishin/about-xcode-4-project-template
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates
Examples:
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate
@shazron
shazron / gist:1009688
Created June 6, 2011 03:27
NativeControls PhoneGap example
window.plugins.nativeControls.createTabBar();
window.plugins.nativeControls.createTabBarItem("home-tab", "Home", "home-icon", {
onSelect: function() {
alert("home");
}
});
window.plugins.nativeControls.showTabBar({position:"bottom"});
window.plugins.nativeControls.showTabBarItems("home-tab");
@shazron
shazron / gist:1045503
Created June 24, 2011 19:36
network.isReachable example (polling)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<!-- iPad/iPhone specific css below, add after your main css >
<link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css" type="text/css" />
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" />
@shazron
shazron / gist:1047331
Created June 26, 2011 06:47
Web SQLite test
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<!-- iPad/iPhone specific css below, add after your main css >
<link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css" type="text/css" />
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" />
@shazron
shazron / gist:1096437
Created July 21, 2011 03:31
wordpress sharedaddy plugin patch for google plus one
$parts[] = '<li class="share-g-plus-one share-regular">' . do_shortcode('[wdgpo_plusone]') . '</li>';
var toolbar = document.createElement('menu');
toolbar.setAttribute('type', 'toolbar');
toolbar.setAttribute('label', 'Home');
var commandBack = document.createElement('command');
commandBack.setAttribute('label', 'Back');
commandBack.setAttribute('accesskey', 'back');
commandBack.setAttribute('action', function() { alert('Back'); });
toolbar.appendChild(commandBack);