Skip to content

Instantly share code, notes, and snippets.

Elliott Chenger erchenger

Block or report user

Report or block erchenger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@erchenger
erchenger / Merging two data sources with rxJava
Last active Aug 29, 2015
How to merge two data sources with rxJava.
View Merging two data sources with rxJava
restObservable = giphyService.searchGiphy(getGiphyQueryMap("dog")).flatMap(new Func1<GiphySearch, Observable<GiphyGif>>() {
@Override
public Observable<GiphyGif> call(GiphySearch giphySearch) {
return Observable.from(giphySearch.data);
}
}).zipWith(namesService.getPeople().flatMap(new Func1<List<People>, Observable<Person>>() {
@Override
public Observable<Person> call(List<People> people) {
return Observable.from(people);
}
@erchenger
erchenger / gist:823226a50bd74b7b07c5
Created Sep 15, 2015
Enable AirDrop on Mac where AirDrop is disabled
View gist:823226a50bd74b7b07c5
defaults write com.apple.NetworkBrowser DisableAirDrop -bool NO
sudo killall Finder
@erchenger
erchenger / LogPid.sh
Last active Sep 15, 2015
Start Logcat for a specific PID
View LogPid.sh
function package {
local PCKG=$1
local PID="$(adb shell ps | grep $PCKG | cut -c10-15)"
echo "<<<<<>>>>> PID for $PCKG: $PID <<<<<>>>>>"
adb logcat | grep $PID
}
package $1
@erchenger
erchenger / gist:1442dac0dd2277053b24
Created Jan 4, 2016
System Alert Window Permission
View gist:1442dac0dd2277053b24
if (!Settings.canDrawOverlays(this)) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, REQUEST_CODE);
} else {
// You have the ability to add things to the window manually
}
@erchenger
erchenger / gist:c0c0b1d1ad36594edaa7
Last active Feb 9, 2016
Formatting Regex for Single Line Android Logs
View gist:c0c0b1d1ad36594edaa7
//Regex
//Replace 19326 with the PID of your app.
([ADEIVW][\/])(.+?)(19326\)\:)
You can’t perform that action at this time.