Skip to content

Instantly share code, notes, and snippets.

@rdrobinson3
rdrobinson3 / delete-merged
Created August 7, 2014 10:38
Delete branches that have merged into master
alias rm-merged-local="git fetch --prune && git branch --merged master | \grep -v 'master' | xargs git branch -D"
@rdrobinson3
rdrobinson3 / squash alias
Created August 26, 2014 14:46
Squash alias for git
rb = "!sh -c 'git rebase -i HEAD~$1' -"
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/twitterUserImage"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="5dp"
/>
Tweet tweet = mData.get(position);
if(tweet != null){
viewHolder.twitterUserImage.setImageUrl(tweet.getUserImageUrl(), ImageCacheManager.getInstance().getImageLoader());
viewHolder.userNameTextView.setText("@" + tweet.getUsername());
viewHolder.messageTextView.setText(tweet.getMessage());
viewHolder.tweetTimeTextView.setText(formatDisplayDate(tweet.getCreatedDate()));
viewHolder.destinationUrl = tweet.getDestinationUrl();
}
#
# Description:
#
# This script adds Site Columns to the appropriate Content Types as listed in
# the AddSiteColumnsToContentTypes.csv. The .CSV needs to be saved to
# "C:\PowerShell\" directory. If this directory does not exist, you will need to create it.
#
# Running this script requires running PowerShell with elevated privileges so right
# click the SharePoint 2010 Management Shell and select "Run as administrator" then use
# change directory commands and tabs to run the PS1 from its directory.
public void init(Context context, String uniqueName, int cacheSize, CompressFormat compressFormat, int quality, CacheType type){
switch (type) {
case DISK:
mImageCache= new DiskLruImageCache(context, uniqueName, cacheSize, compressFormat, quality);
break;
case MEMORY:
mImageCache = new BitmapLruImageCache(cacheSize);
default:
mImageCache = new BitmapLruImageCache(cacheSize);
break;
Intent intent;
if(ParseUser.getCurrentUser() == null){
intent = new Intent(this, LoginActivity.class);
}else{
intent = new Intent(this, MainActivity.class);
}
startActivity(intent);
this.finish();
<RelativeLayout
android:id="@+id/postHeader"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:background="@drawable/post_header_background" >
<RelativeLayout
android:id="@+id/postHeader"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:alpha=".5">
public class MyAdapter extends BaseAdapter {
@Override public void getView(int position, View view, ViewGroup parent) {
ViewHolder holder;
if (view != null) {
holder = (ViewHolder) view.getTag();
} else {
view = inflater.inflate(R.layout.whatever, parent, false);
holder = new ViewHolder(view);
view.setTag(holder);
}