Skip to content

Instantly share code, notes, and snippets.

View marshall's full-sized avatar

Marshall Culpepper marshall

View GitHub Profile
// Note: this isn't public API, so there should be lots of error checking here
Method gciMethod = Resources.class.getMethod("getCompatibilityInfo");
Object compatInfo = gciMethod.invoke(view.getResources());
float appScale = (Float)compatInfo.getClass().getField("applicationScale").get(compatInfo);
<ti:app>
<!-- ... -->
<property name="ti.android.google.map.api.key.production">GET_ME_FROM_GOOGLE</property>
</ti:app>
SSH_ENV=$HOME/.ssh/environment
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo succeeded
chmod 600 ${SSH_ENV}
. ${SSH_ENV} > /dev/null
/usr/bin/ssh-add ~/.ssh/marshall_github_key;
}
<html>
<head>
<style>
#square {
background-color: black;
color: white;
font-size: 30pt;
padding: 10px;
width: 350px;
}
<html>
<head>
<style>
body { font-family: Monaco; }
#drop_target {
-webkit-user-drop: element;
border-bottom: 2px dashed black;
background-color: #303030;
color: #909090;
font-size: 16px;