Skip to content

Instantly share code, notes, and snippets.

@jlindenbaum
jlindenbaum / HttpConnectionHelper.java
Created August 27, 2012 16:28
BlackBerry Connection Utility
import java.io.InputStream;
import java.util.Hashtable;
import javax.microedition.io.HttpConnection;
import javax.microedition.io.InputConnection;
import net.rim.device.api.io.IOUtilities;
import net.rim.device.api.io.http.HttpProtocolConstants;
import net.rim.device.api.io.transport.ConnectionDescriptor;
import net.rim.device.api.io.transport.ConnectionFactory;
@jlindenbaum
jlindenbaum / KeychainItemWrapper.h
Created July 11, 2012 15:08 — forked from dhoerl/KeychainItemWrapper.h
KeychainItemWrapper ARCified
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@jlindenbaum
jlindenbaum / gist:1683280
Created January 26, 2012 15:28
"Caching" in Object fields
/**
* Creates a new GeoPoint only if
* a GeoPoint object does not exist
* within the object already
*/
public GeoPoint getGeoPoint() {
if (this.geoPoint == null) {
this.geoPoint = new GeoPoint(this.lat, this.lng);
}
return this.geoPoint;