This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
public class TweetAdapter extends BaseAdapter { | |
// ... | |
public View getView(int position, View convertView, ViewGroup parent) { | |
TweetViewHolder vh = TweetViewHolder.get(convertView, parent); | |
Tweet item = getItem(position); | |
vh.user.setText(item.user); | |
vh.tweet.setText(item.tweet); |
/* Base fragment to ensure the parent activity implements a contract interface. */ | |
public abstract class ContractFragment<T> extends Fragment { | |
private T mContract; | |
@Override | |
public void onAttach(Activity activity) { | |
try { | |
mContract = (T)activity; | |
} catch (ClassCastException e) { | |
throw new IllegalStateException(activity.getClass().getSimpleName() |
#!/usr/bin/python | |
import sys | |
import argparse | |
import os | |
import re | |
''' | |
A simple script to create lower-resolution Android drawables from higher-resolution ones. |
var GCM = require('./gcm'); | |
var gcm = new GCM(<YOUR GOOGLE API KEY>); // https://code.google.com/apis/console | |
// create the message | |
var msg = { | |
registration_ids: [token], // this is the device token (phone) | |
collapse_key: "your_collapse_key", // http://developer.android.com/guide/google/gcm/gcm.html#send-msg | |
time_to_live: 180, // just 30 minutes | |
data: { |
package com.arpit.animatortest; | |
import android.animation.AnimatorSet; | |
import android.animation.LayoutTransition; | |
import android.animation.ObjectAnimator; | |
import android.app.Activity; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.View; |
package cz.eman.android.hosl.ui.widget; | |
import java.util.ArrayList; | |
import java.util.List; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.LinearLayout; |
//http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling | |
public class VerticalScrollView extends ScrollView { | |
private float xDistance, yDistance, lastX, lastY; | |
public VerticalScrollView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
@Override | |
public boolean onInterceptTouchEvent(MotionEvent ev) { |
# zsh script checks first if there were any commits done | |
# by author yesterday. If there were, return those. If | |
# there weren't, look for all commits since last Friday | |
# at midnight as it may have been a weekend. | |
# | |
# Use your name in the --author for all commands | |
gitstandup() { | |
if [ -z "$(git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=yesterday.midnight)" ]; then | |
git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=last.friday.midnight; |
/** | |
* Author: Michael Ritchie, ThanksMister LLC | |
* Date: 10/16/12 | |
* Web: thanksmister.com | |
* | |
* Extension of <code>TextView</code> that adds listener for ellipses changes. This can be used to determine | |
* if a TextView has an ellipses or not. | |
* | |
* Derived from discussion on StackOverflow: | |
* |