Skip to content

Instantly share code, notes, and snippets.

View phpmaps's full-sized avatar
💭
Lending a helping hand on the web.

Doug Carroll phpmaps

💭
Lending a helping hand on the web.
View GitHub Profile
@phpmaps
phpmaps / gist:5249567
Created March 26, 2013 21:41
Esri request
dojo.byId("url").value ="http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt";
var requestHandle = esri.request({
url: url.path,
content: url.query,
handleAs: "text",
load: requestSucceeded,
error: requestFailed
},{useProxy:true});
@phpmaps
phpmaps / gist:5249656
Created March 26, 2013 21:53
ArcGIS JSAPI setRequestPreCallback
esri.setRequestPreCallback(updateAddressParameters); //goes in init()
function updateAddressParameters(ioArgs) {
if ( ioArgs.url.indexOf("findAddressCandidates") != -1) {
ioArgs.content["Single Line Input"] = "201 s jackson st, Seattle, 98104";
}
return ioArgs; }
@phpmaps
phpmaps / gist:5270552
Created March 29, 2013 12:35
Show all users on linux
cat /etc/passwd | cut -d ":" -f1
@phpmaps
phpmaps / gist:5270946
Created March 29, 2013 13:45
Check if Linux machine uses a 32 or 64 bit processor. If output displays "X86_64.." it is a 64 bit processor.
uname -a
@phpmaps
phpmaps / gist:5270982
Created March 29, 2013 13:49
Download file using Linux command
wget http://www.globebeta.com/package.zip
@phpmaps
phpmaps / gist:5271773
Created March 29, 2013 16:07
Make file executable on linux
chmod a+x jdk-6u43-linux-i586.rpm
@phpmaps
phpmaps / gist:5271821
Created March 29, 2013 16:13
Set JDK on Linux
#Verify presence of an installed jdk on Redhat
cd /usr/java/jdk1.6.0_xxx
#As root, install java system wide on Redhat using alternatives
cd /usr/sbin
alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_43/bin/java 1
@phpmaps
phpmaps / gist:5464216
Created April 26, 2013 00:05
Get location providers from a Droid's LocationManager
LinearLayout providerListLayout = (LinearLayout) findViewById(R.id.providerList);
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
providers = locationManager.getProviders(true);
for (String provider : providers) {
System.out.println(provider);
final TextView row = new TextView(this);
row.setText(provider);
providerListLayout.addView(row);
}
@phpmaps
phpmaps / gist:5465128
Created April 26, 2013 05:02
Get hold of class extending application. In this case the class name is ApplicationController.
ApplicationController application = ((ApplicationController)this.getApplication());
@phpmaps
phpmaps / gist:5465163
Created April 26, 2013 05:13
Object to integer
int ordinal = Integer.parseInt((String) objValue);