Skip to content

Instantly share code, notes, and snippets.

View donnfelker's full-sized avatar

Donn Felker donnfelker

View GitHub Profile
@donnfelker
donnfelker / main.xml
Created August 3, 2011 21:01
spring loading your textviews
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#6a9938"
>
<TextView
android:layout_height="wrap_content"
@donnfelker
donnfelker / between-develop.sh
Created August 31, 2011 15:10
Git Difftool between branches
git difftool develop...feature/dateformatter
@donnfelker
donnfelker / demo.txt
Created September 21, 2011 19:25
Maven Third Party Repo
# This will create a pom, md5 and sha1 for the jar and pom in your ~/.m2/ directory.
# here i'm installing the FlurryAgent from my /tmp/ directory
mvn install:install-file -Dfile=/tmp/FlurryAgent.jar -DgroupId=com.flurry -DartifactId=FlurryAgent -Dversion=2.2 -Dpackaging=jar -DcreatePom=true -DcreateChecksum=true
# Copy this entire folder from your ~/.m2/ folder
# Place it into your third.party.closed.source repo (local repo checked into source control)
# In your applications pom file, add a third party repo
@donnfelker
donnfelker / Error
Created November 26, 2011 03:53
ruby_mongo_playground_issue
/Users/donnfelker/.rvm/gems/ruby-1.9.2-p136@upc-etl/gems/bson-1.4.0/lib/bson/types/object_id.rb:126:in `from_string': illegal ObjectId format: _id (BSON::InvalidObjectId)
from migrate_upc_from_csv.rb:13:in `block in <main>'
from /Users/donnfelker/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/csv.rb:1768:in `each'
from /Users/donnfelker/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/csv.rb:1202:in `block in foreach'
from /Users/donnfelker/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/csv.rb:1340:in `open'
from /Users/donnfelker/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/csv.rb:1201:in `foreach'
from migrate_upc_from_csv.rb:9:in `<main>'
@donnfelker
donnfelker / count_bubble.xml
Created December 2, 2011 20:44
Count Bubble Layout
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:startColor="#b30e13"
android:endColor="#f5343b"
/>
@donnfelker
donnfelker / install_ruby.sh
Created March 26, 2012 17:19
Install Ruby when you get LVVM Error
# Depends on system, might need to perform "which gcc-4.2" to find location of gcc-4.2
# Once found, install the version of Ruby you need here. Change the version of ruby to one
# that matches your needs.
CC=/usr/bin/gcc-4.2 rvm reinstall ruby-1.8.7-p334
@donnfelker
donnfelker / cc.xml
Created March 27, 2012 17:48
Android XMLNS
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:orientation="vertical"
>
<ScrollView
a:layout_width="fill_parent"
a:layout_height="0dp"
a:layout_weight="1"
@donnfelker
donnfelker / EditCredtCardIntl.java
Created March 27, 2012 17:52
EditCredtCardIntl.java
public class EditCreditCardIntl extends EditCreditCard {
@InjectView( R.id.cc_payment_method_layout ) LinearLayout paymentMethodLayout;
@InjectView( R.id.cc_payment_method ) Spinner paymentMethod;
// other code
}
@donnfelker
donnfelker / example.js
Created June 27, 2012 21:20
Express 3 Changes in res.json
// v0.6.19 way of returning JSON.
exports.index = function(req, res) {
Workout.find({}, function(err, docs) {
if(!err) {
res.json( { workouts: docs }, 200);
} else {
res.json( { message: err }, 500);
}
});
}
@donnfelker
donnfelker / gist:4388456
Created December 27, 2012 13:41
Centering in Bootstrap
http://jsfiddle.net/rfkrocktk/hcQ48/