Skip to content

Instantly share code, notes, and snippets.

View RoyGoode's full-sized avatar

Roy Goode RoyGoode

View GitHub Profile
@RoyGoode
RoyGoode / AndroidResourceXml.kt
Created April 17, 2024 10:35
Get simple Android Resource XML as a string
private fun getPowerProfileXml(): String {
val resources = Resources.getSystem()
val resId = resources.getIdentifier("power_profile", "xml", "android")
return getResourceXmlString(resources, resId)
}
private fun getResourceXmlString(resources: Resources, resId: Int): String {
val xml = resources.getXml(resId)
val xmlText = StringBuilder()
val indent = " "
@RoyGoode
RoyGoode / gist:3304079
Created August 9, 2012 13:11
Assign differently sized, device-targeted iOS friendly icons to a web page
<link rel="apple-touch-icon" href="apple-touch-icon-iphone.png" />
<link rel="apple-touch-icon" sizes="72x72" href="apple-touch-icon-ipad.png" />
<link rel="apple-touch-icon" sizes="114x114" href="apple-touch-icon-iphone-retina-display.png" />
@RoyGoode
RoyGoode / gist:3303931
Created August 9, 2012 12:52
Assign an iOS friendly icon to a web page
<link rel="apple-touch-icon" href="my_icons/my_icon_file_path.png" />