Skip to content

Instantly share code, notes, and snippets.

Avatar

Donn Felker donnfelker

View GitHub Profile
@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 / .gitconfig
Last active Mar 19, 2021
Git and Fish
View .gitconfig
[user]
name = Your Name
email = you@youremail.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
@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;
View keybase.md

Keybase proof

I hereby claim:

  • I am donnfelker on github.
  • I am donnfelker (https://keybase.io/donnfelker) on keybase.
  • I have a public key ASDm0EqsT8YBPE8L0BlrQxAppoKpbs_C1r-ZER8m2blYmAo

To claim this, I am signing this object:

@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 / config
Last active Nov 19, 2019
Watch or Unwatch a file in git
View config
# Goes in your .git/config file
[alias]
# Temporarily stop tracking a file in git.
# usage: git unwatch path/to/file
unwatch = update-index --assume-unchanged
# Resume tracking a file in git.
# usage: git watch path/to/file
watch = update-index --no-assume-unchanged
View gist:5391295
// Connect to your API with your http lib, i use http-request: https://github.com/kevinsawicki/http-request
// Then get the reader. The 'request' variable below is just a HttpRequest object
// as shown here: http://kevinsawicki.github.io/http-request/
final Reader reader = request.reader();
final ObjectMapper mapper = new ObjectMapper();
final JsonFactory factory = mapper.getFactory();
// Create a new streaming parser with the reader
JsonParser jp = factory.createParser(reader);
@donnfelker
donnfelker / RobolectricActivityTest.java
Created Nov 11, 2017
Integrating Robolectric 3 with Android Studio 2
View RobolectricActivityTest.java
package com.greenlifesoftware.robolectricpractice;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import static org.junit.Assert.assertNotNull;
@donnfelker
donnfelker / macbook-lock-screen.sh
Created Jul 15, 2018
Mac Lock Screen Window Text
View macbook-lock-screen.sh
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "If found, contact YOUR-NAME at XXX-XXX-XXXX"