Skip to content

Instantly share code, notes, and snippets.

JemarJones / jQuery Fallback
Created July 7, 2015 01:36
A function that replicates the familiar javascript fallback functionality for jquery objects (which are truthy).
View jQuery Fallback
var fallback = function(options){
var numOfOptions = options.length;
if (numOfOptions == 2){
return (options[0].length > 0)? options[0] : options[1];
}else if (numOfOptions > 2){
return fallback(options.slice(1));
}else if (numOfOptions == 1){
return options[0];
return $();
JemarJones /
Last active December 5, 2015 09:14
Bash script to wait for time machine backup to finish, unmount drive, and shutdown
# Requesting sudo if we don't have it already
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
if [[ -z "$1" ]]; then
#Replace this with your default harddrive (list them all with "df -h")
package okhttp3;
import junit.framework.Assert;
import org.junit.Test;
public class ResponseBodyNeverNullTest {
public void responseBodyNeverNull() {
Response testResponse = new Response.Builder()

Keybase proof

I hereby claim:

  • I am jemarjones on github.
  • I am jemarjones ( on keybase.
  • I have a public key ASDzxw2BwMFxpVHxSl7JkF0AMK5xu4kC1TqYEZYTabYokgo

To claim this, I am signing this object: