Skip to content

Instantly share code, notes, and snippets.

View LOG-TAG's full-sized avatar

Subrahmanya S M LOG-TAG

View GitHub Profile
/*
Nice to study. Original here http://www.20thingsilearned.com/js/twentythings.min.js
*/
var TT = TT || {};
TT.PAGE_WIDTH = 800;
TT.PAGE_HEIGHT = 500;
TT.PAGE_MIN_WIDTH = 1000;
TT.PAGE_MIN_HEIGHT = 680;
TT.PAGE_MARGIN_LEFT = 32;
@danielhawkes
danielhawkes / MediaPlayerStateWrapper.java
Created June 16, 2011 15:58
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import android.media.AudioManager;
import android.media.MediaPlayer;
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@qihnus
qihnus / RecorderService.java
Created February 25, 2012 17:23
a minimalist example of Android accessibility service
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class RecorderService extends AccessibilityService {
static final String TAG = "RecorderService";
private String getEventType(AccessibilityEvent event) {
@miguelibero
miguelibero / gist:2043782
Created March 15, 2012 11:34
Android LayoutInflater.Factory to overwrite menu item style
package org.santamonica.module;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.lang.reflect.Method;
import org.santamonica.R;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/baseView"
android:background="#FFFFFFFF"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
@romannurik
romannurik / button_bar_layout.xml
Created April 10, 2012 04:24
How to make a proper button bar on ICS
<!--
A button bar is a set of buttons at the bottom of an activity.
An example is an AlertDialog with OK/Cancel buttons.
Note that something similar can be accomplished using a
split action bar and text-only action buttons, but this is an
alternate presentation that's often preferred.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
@paour
paour / button_bar_layout.xml
Created April 11, 2012 06:16 — forked from romannurik/button_bar_layout.xml
How to make a proper button bar on ICS
<!--
A button bar is a set of buttons at the bottom of an activity.
An example is an AlertDialog with OK/Cancel buttons.
Note that something similar can be accomplished using a
split action bar and text-only action buttons, but this is an
alternate presentation that's often preferred.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
@kinlane
kinlane / downloadEvent.java
Created April 14, 2012 19:00
IDrive - EVS - REST API - downloadEvent
String params=&quot;uid=&quot;+user+&quot;&amp;pwd=&quot;+pass+&quot;&amp;month=&quot;+month+&quot;&amp;year=&quot;+year+&quot;&amp;eventid=&quot;+eventid;
URL evsURL = new URL(&quot;https://&lt;server address&gt;/evs/downloadEvent&quot;);
HttpURLConnection con = (HttpURLConnection) evsURL.openConnection();
con.setRequestMethod(&quot;POST&quot;);
con.setRequestProperty(&quot;Content-Type&quot;,&quot;application/x-www-form-urlencoded; charset=UTF-8&quot;);
@markusfisch
markusfisch / DemoBubblesView.java
Last active February 21, 2023 19:58
Draw text in a given rectangle and automatically wrap lines on a Android Canvas
package de.markusfisch.android.textrect.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;
import de.markusfisch.android.textrect.graphics.TextRect;