Skip to content

Instantly share code, notes, and snippets.

View jmathai's full-sized avatar

Jaisen Mathai jmathai

View GitHub Profile
@jmathai
jmathai / openphoto.pp
Created February 15, 2012 18:34
OpenPhoto puppet script
class openphoto {
exec { "apt-update":
command => "/usr/bin/apt-get update",
refreshonly => true;
}
# base
package {
"exiftran" :
ensure => installed,
@jmathai
jmathai / embed_image.markdown
Created December 2, 2011 20:35
Display an image in a Github issue

@jmathai
jmathai / adb-logcat.txt
Created November 11, 2011 08:00
OpenPhoto logcat from Android
--------- beginning of /dev/log/system
D/WifiService( 129): acquireWifiLockLocked: WifiLock{NetworkLocationLocator type=2 binder=android.os.BinderProxy@408bf5f0} Mode: 2
D/WifiService( 129): disable wifi due to updateWifiState
D/WifiService( 129): releaseWifiLockLocked: WifiLock{NetworkLocationLocator type=2 binder=android.os.BinderProxy@408bf5f0} Mode: 2
D/WifiService( 129): disable wifi due to updateWifiState
D/StatusBarPolicy(32056): hasService()=true ,mDataState=2 ,mPhone.htcModemLinkOn()=false ,mDataActivity=0
D/StatusBarPolicy(32056): slotType[0]=empty
D/StatusBarService(32056): updateIcon slot=data_connection index=18 viewIndex=13 old=StatusBarIcon(pkg=com.android.systemui id=0x7f020015 level=0 visible=true num=0 ) icon=StatusBarIcon(pkg=com.android.systemui id=0x7f020015 level=0 visible=true num=0 )
D/WifiService( 129): acquireWifiLockLocked: WifiLock{NetworkLocationLocator type=2 binder=android.os.BinderProxy@408bf5f0} Mode: 2
D/WifiService( 129): disable wifi due to updateWifiState
@jmathai
jmathai / function.php
Created February 4, 2011 16:19
function.php
<?php
/*
* This is a sample function that guarantees unique URLs for frontend assets.
* Images for example.
* Include this and your users will never re-download an asset they already
* have just just because you push a new build.
* If including this in your stylesheet then you should set this up in you
* should be using something like Amazon Cloud Front to cache a static
* version of it.
*/
#!/bin/bash
# Ease staging of files
for i in $(git status | grep -A 10000 "not updated" | grep modified) ; do
if [ -f $i ] ; then
git diff $i;
echo -n "Add this to stage? [y/n]: ";
read ans;
if [ "$ans" == "y" ] ; then
# convert a unix timestamp into a readable date
date -d @1252374518
@jmathai
jmathai / twitter_oauth_image_upload.php
Created June 11, 2009 03:44
Upload photos to Twitter's OAuth API using PHP
// This uses twitter-async from GitHub
// Source: https://github.com/jmathai/twitter-async/tree
// Documentation: http://wiki.github.com/jmathai/twitter-async
include 'EpiOAuth.php';
include 'EpiTwitter.php';
$twitterObj = new EpiTwitter('YourConsumerKey', 'YourConsumerSecret', 'Token', 'TokenSecret');
$params = array('@image' => '@/absolute/path/to/image.jpg');
$uploadResp = $twitterObj->post_accountUpdate_profile_image($params);