Skip to content

Instantly share code, notes, and snippets.


Donn Felker donnfelker

View GitHub Profile
View .gitconfig
name = Your Name
email =
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD

Keybase proof

I hereby claim:

  • I am donnfelker on github.
  • I am donnfelker ( on keybase.
  • I have a public key ASDm0EqsT8YBPE8L0BlrQxAppoKpbs_C1r-ZER8m2blYmAo

To claim this, I am signing this object:

donnfelker /
Created Jul 15, 2018
Mac Lock Screen Window Text
sudo defaults write /Library/Preferences/ LoginwindowText "If found, contact YOUR-NAME at XXX-XXX-XXXX"
donnfelker / prettify.css
Last active Jun 5, 2018 - code theme
View prettify.css
/*! Color themes for Google Code Prettify | MIT License | */
.prettyprint {
background: #f5f5f5;
font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace;
border: 0 !important;
padding: 16px;
.pln {
color: #4d4d4c;
donnfelker /
Created Nov 11, 2017
Integrating Robolectric 3 with Android Studio 2
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 / CustomBindingAdapters.kt
Last active Oct 20, 2017
MVVM - Removing Logic from Your Views with BindingAdapters
View CustomBindingAdapters.kt
fun setIsVisible(view: View, isVisible: Boolean) {
if (isVislble) {
view.visibility = View.VISIBLE
} else {
view.visibility = View.GONE
donnfelker /
Created Jul 13, 2017 — forked from Vestride/
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc --with-opus
donnfelker / circle.yml
Created Dec 13, 2016
Updated circle.yml file for Caster.IO
View circle.yml
# Build configuration for Circle CI
# See this thread for speeding up and caching directories:
- /home/ubuntu/AndroidCI/app/build/outputs/apk/
View friendly_urls.markdown

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:


But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

donnfelker / config
Last active Nov 19, 2019
Watch or Unwatch a file in git
View config
# Goes in your .git/config file
# 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