Skip to content

Instantly share code, notes, and snippets.

View phil-brown's full-sized avatar

Phil Brown phil-brown

  • Boston, MA
View GitHub Profile
@phil-brown
phil-brown / LocaleUtility.java
Last active January 3, 2017 07:54
Utility for getting the Script String using a Locale. This is useful, for example, in Android, where this is not part of the Locale Object. To use this, simply call `LocaleUtility.getScript(Locale.getDefault());` to get the script for the current users' Locale.
/*
* Copyright 2013 Phil Brown
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@phil-brown
phil-brown / droidQuery-rss
Created August 7, 2013 20:22
An example of how one can use android-rss (https://github.com/ahorn/android-rss) with droidQuery (http://bit.ly/droidquery).
final RSSHandler handler = new RSSHandler(new RSSConfig());
$.ajax(new AjaxOptions().url(options.url())
.type("GET")
.dataType("XML")
.context(this)
.SAXContentHandler(handler)
.success(new Function() {
@Override
public void invoke($ droidQuery, Object... params) {
RSSFeed feed = handler.feed();