This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class RadioAdapter<T> extends RecyclerView.Adapter<RadioAdapter.ViewHolder> { | |
public int mSelectedItem = -1; | |
private Context mContext; | |
private List<T> mItems; | |
public RadioAdapter(Context context, List<T> items) { | |
mContext = context; | |
mItems = items; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//experiment: can i determine the types of the generic parameters? | |
class StringIntMap extends HashMap<String,Integer> { } | |
TypeResolver typeResolver = new TypeResolver(); | |
ResolvedType type = typeResolver.resolve(StringIntMap.class); | |
List<ResolvedType> mapParams = type.typeParametersFor(Map.class); | |
ResolvedType keyType = mapParams.get(0); | |
ResolvedType valueType = mapParams.get(1); | |
System.out.println("generic key type: " + keyType); | |
//generic key type: java.lang.String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.joshskeen.rxjava_example.model; | |
import java.util.ArrayList; | |
import java.util.List; | |
import de.greenrobot.event.EventBus; | |
import retrofit.Callback; | |
import retrofit.RetrofitError; | |
import retrofit.client.Response; | |
import rx.Observable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Done! Here's the API key and secret for your new app: | |
my_awesome_application! | |
Key: | |
e584ad79aac78ce42e1ca816bd814b5e | |
Secret: | |
4626f13d81ec8997 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm list packages -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history | cut -c 8- | grep 'git' | sort | uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
require 'twitter' | |
require 'mactts' | |
require 'hue' | |
hueclient = Hue::Client.new | |
last_text = "" | |
state = {} | |
light_on = false | |
hue = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<string-array name="states"> | |
<item>AL</item> | |
<item>AR</item> | |
<item>AZ</item> | |
<item>CA</item> | |
<item>CO</item> | |
<item>CT</item> | |
<item>DE</item> | |
<item>DC</item> | |
<item>FL</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for k in `git branch | perl -pe s/^..//`; do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k; done | sort -r | sed "$1"q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestFoo | |
def initialize(foo: nil, baz: nil, is_awesome: nil, this_ones_required: nil) | |
@foo = foo | |
@baz = baz | |
@is_awesome = is_awesome | |
@this_ones_required = this_ones_required or raise ArgumentError.new("this ones required!") | |
end | |
def to_s | |
"foo: #{@foo}, baz: #{@baz}, is_awesome: #{@is_awesome.to_s}, this_ones_required: #{@this_ones_required}" |