Skip to content

Instantly share code, notes, and snippets.

View mwbrooks's full-sized avatar
🏠
Working from home

Michael Brooks mwbrooks

🏠
Working from home
View GitHub Profile
@mwbrooks
mwbrooks / config.xml
Created May 25, 2011 22:26
BlackBerry WebWorks Child Browser
<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />
<feature id="blackberry.identity" />
@mwbrooks
mwbrooks / Makefile
Created March 16, 2011 23:05
BlackBerry Playbook Makefile to build and deploy.
#
# Package and Deploy to the Playbook
#
# Getting Started:
#
# 1. Update ADDRESS with your Playbook IP Address
# 2. Update PASSWORD with your Playbook password
# 3. Update SDK_DIR with the path to the Playbook WebWorks SDK
#
# Usage:
@mwbrooks
mwbrooks / bb-code-signing-backup.md
Created March 15, 2011 17:45
Backup BlackBerry Code-Signing Keys

Backup your BlackBerry Code-Signing Keys

  1. Find the SDK directory where you installed your keys

Installed using Eclipse

C:\Eclipse-3.5.2\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components\
@mwbrooks
mwbrooks / thumbs.alunny.js
Created March 2, 2011 07:21
code golf! 446 bytes minified (yui-compressor defaults)
(function(window, document) {
/**
* Do not use thumbs.js on touch-enabled devices
*/
if (document.ontouchstart) return;
/**
* Map touch events to mouse events
*/
@mwbrooks
mwbrooks / style.css
Created February 23, 2011 18:50
Remove Tap Highlight from Mobile Webkit
* {
-webkit-touch-callout:none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust:none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color / shadow */
-webkit-user-select:none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
@mwbrooks
mwbrooks / style.css
Created February 22, 2011 19:34
Remove input field shadow from iOS-Webkit
input[type="text"] {
-webkit-appearance:none; /* Remove default shadow */
border:1px solid black; /* Possibly apply a custom border */
}
@mwbrooks
mwbrooks / projectAppDelegate.m
Created February 15, 2011 18:43
ON PhoneGap-iOS, open external links in the external browser (Safari.app)
/**
* Note: the following function should already exist in your application delegate file.
* Replace it with the following implementation.
*
* Thanks to @purplecabbage for implementation.
* Thanks to Ruddiger for the iFrame patch.
*/
// ...
@mwbrooks
mwbrooks / MyProjectAppDelegate.m
Created February 9, 2011 18:57
Disable telephone number detection in PhoneGap-iOS
// ...
- (void)webViewDidStartLoad:(UIWebView *)theWebView
{
// disable telephone detection, basically <meta name="format-detection" content="telephone=no" />
theWebView.dataDetectorTypes = UIDataDetectorTypeAll ^ UIDataDetectorTypePhoneNumber;
return [ super webViewDidStartLoad:theWebView ];
}
@mwbrooks
mwbrooks / app.js
Created February 4, 2011 16:36
Quick example of invoking a browser window using BlackBerry WebWorks
//
// only invoke the browser when using BlackBerry WebWorks
//
if (typeof blackberry !== 'undefined') {
var args = new blackberry.invoke.BrowserArguments('http://phonegap.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}
@mwbrooks
mwbrooks / battery-plugin.js
Created February 2, 2011 23:25
Plugin example
(function() {
var Battery = function() {
return {
//
// Get a battery property
//
// @param property to get. Only 'Power' is supported.
// @param successCallback is provided an argument { level: [0, 100] }
// @param errorCallback is called on any native error and provided a message
//