Skip to content

Instantly share code, notes, and snippets.

View pbnkp's full-sized avatar
💭
Endlessly working like a little OinK🐽🐽

pbnkp pbnkp

💭
Endlessly working like a little OinK🐽🐽
  • 06:07 (UTC -07:00)
View GitHub Profile
@pbnkp
pbnkp / navigator.geolocation.getAccuratePosition
Created December 28, 2011 14:58 — forked from apinstein/navigator.geolocation.getAccuratePosition
navigator.geolocation.getAccuratePosition
// navigator.geolocation.getAccuratePosition() is an improved version of navigator.geolocation.getCurrentPosition()
//
// getAccuratePosition() is designed and tested for iOS.
//
// The problem with getCurrentPosition() is that it returns an inaccurate position even with "enableHighAccuracy" enabled.
// The problem with watchPosition() is that it calls the success handler every second, and it is resource-intensive.
//
// getAccuratePosition() calls the callback only once, but uses watchLocation() internally to obtain a position that meets your accuracy needs.
// If the timeout is exceeded before a position meeting your accuracy is needed, the best position is returned to the
// success callback, and the error callback does not fire. If you really care about accuracy, you should check it
@pbnkp
pbnkp / jquery.spin.js
Created December 17, 2011 13:46 — forked from innotekservices/jquery.spin.js
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@pbnkp
pbnkp / xcode.rb
Created November 19, 2011 04:17 — forked from derencius/xcode.rb
Download Xcode using wget. Useful for slow or intermittent connections. it uses wget and mechanize.
require 'rubygems'
require 'mechanize'
if ARGV.size < 3
puts %q{Usage: ruby xcode.rb USERNAME PASSWORD "DOWNLOAD_URL" [WGET_PARAMS]}
puts %q{Example: ruby xcode.rb [email protected] 123456 "https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg" }
exit
end
a = Mechanize.new { |agent|
@pbnkp
pbnkp / mobile-meta-links.html
Created August 31, 2011 11:01
iOS Web App Configuration