Skip to content

Instantly share code, notes, and snippets.

Avatar

Donn Felker donnfelker

View GitHub Profile
@donnfelker
donnfelker / circle.yml
Created Jun 2, 2016
Updated circle.yml file
View circle.yml
#
# Build configuration for Circle CI
#
# See this thread for speeding up and caching directories: https://discuss.circleci.com/t/installing-android-build-tools-23-0-2/924
#
general:
artifacts:
- /home/ubuntu/AndroidCI/app/build/outputs/apk/
@donnfelker
donnfelker / OrderActivity.java
Last active Nov 22, 2019
RxJava Bound Service AIDL Abstraction
View OrderActivity.java
package com.donnfelker.rxexample;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@donnfelker
donnfelker / android-19-circle.yml
Last active Mar 12, 2021
Sample CircleCI Configuration For an Android App
View android-19-circle.yml
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/your-app-name/app/build/outputs/apk/
machine:
environment:
@donnfelker
donnfelker / CircularTransformation.java
Last active Dec 2, 2020
Picasso and CircularTransform Example
View CircularTransformation.java
import android.graphics.*;
import com.squareup.picasso.Transformation;
/**
* Transforms an image into a circle representation. Such as a avatar.
*/
public class CircularTransformation implements Transformation
{
int radius = 10;
@donnfelker
donnfelker / build.gradle
Last active May 30, 2017
gradle properties in Android Studio
View build.gradle
// Other build stuff
task ndkBuild(type:Exec) {
if(androidNdkPath != null) {
def ndkBuild = new File(androidNdkPath, 'ndk-build')
commandLine ndkBuild
} else {
// do something else
}
}
@donnfelker
donnfelker / .gitconfig
Last active Aug 15, 2021
My .gitconfig
View .gitconfig
[user]
name = FirstName LastName
email = you@yourdomain.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
@donnfelker
donnfelker / build.gradle
Created Jan 31, 2014
Excluding with Gradle
View build.gradle
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile('com.google.android.gms:play-services:3.1.+') {
exclude module: 'support-v4'
}
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:13.0.+'
compile 'com.squareup.dagger:dagger:1.1.0'
compile 'com.squareup.dagger:dagger-compiler:1.1.0'
compile 'com.squareup.picasso:picasso:2.1.1'
View mongoadd
//r = require('rethinkdb')
var MongoClient = require('mongodb').MongoClient,
format = require('util').format;
var querystring = require('querystring');
var https = require('https');
var Inserter = function (collection) {
this.collection = collection;
@donnfelker
donnfelker / DeepLinkRouterTest.java
Last active Jul 19, 2016
ShadowTaskStackBuilder Blog Code
View DeepLinkRouterTest.java
@Test
public void shouldBeAbleToGoToComments() {
Uri deepLink = Uri.parse("pfm:///user/frank/status/123/?version=88983845");
System.out.println(String.format("Testing %s", deepLink.toString()));
// The intent to start.
Intent expectedIntent = new Intent(Robolectric.application, Status.class);
expectedIntent.putExtra(Constants.Extras.STATUS_ID, 123L);
@donnfelker
donnfelker / BootstrapModule.java
Last active Dec 21, 2015
UrlImageView.java - Abstracts Picasso behind a custom ImageView and injects Picasso via Dagger.
View BootstrapModule.java
import dagger.Module;
import dagger.Provides;
@Module
(
complete = false
)
public class BootstrapModule {
@Provides
Picasso providesPicasso(Context context) {