Skip to content

Instantly share code, notes, and snippets.

William Crandell CrandellWS

Block or report user

Report or block CrandellWS

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
anonymous
anonymous / SharedPrefsSavable.java
Created Jan 17, 2015
SharedPrefsSavable
View SharedPrefsSavable.java
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.google.gson.Gson;
/** A base class which will allow your class to be Json-serialized to a private SharedPreferences storage.
*/
public class SharedPrefsSavable {
/** True if the object was created from scratch this session */
private transient boolean mIsNew;
@NKjoep
NKjoep / myprompt-bash.sh
Last active Sep 27, 2016
My Bash Prompt
View myprompt-bash.sh
# Color Reset
Color_Off="\033[0m" # Text Reset
# Regular Colors
Black="\033[0;30m" # Black
Red="\033[0;31m" # Red
Green="\033[0;32m" # Green
Yellow="\033[0;33m" # Yellow
Blue="\033[0;34m" # Blue
Purple="\033[0;35m" # Purple
View Android CI.md

#Android and CI and Gradle (A How-To)

There are tech stacks in this world that make it dead simple to integrate a CI build system.
The Android platform is not one of them.

Although Gradle is getting better, it's still a bit non-deterministic, and some of the fixes you'll need will start to feel more like black magic than any sort of programming.

But fear not! It can be done!

Before we embark on our journey, you'll need a few things to run locally:

View Android CI
#Android and CI and Gradle (A How-To)
There are tech stacks in this world that make it dead simple to integrate a <abbr title="Continuous Integration">CI</abbr> build system. <br>
The Android platform is not one of them.
Although Gradle is getting better, it's still a bit non-deterministic, and some of the fixes you'll need will start to feel more like black magic than any sort of programming.
But fear not! It can be done!
Before we embark on our journey, you'll need a few things to run locally:
@claviska
claviska / vertically-centered-bootstrap-modals.js
Last active Aug 8, 2017
Vertically Centered Bootstrap Modals
View vertically-centered-bootstrap-modals.js
/**
* Vertically center Bootstrap 3 modals so they aren't always stuck at the top
*/
$(function() {
function reposition() {
var modal = $(this),
dialog = modal.find('.modal-dialog');
@mbostock
mbostock / README.md
Last active Nov 5, 2017
Infinite Queue
View README.md

A little demo of an infinitely long-living queue with 6 parallel slots for tasks. The sentinel task that never invokes the callback prevents the queue from ending, even if there are not any currently-active tasks.

There is a downside to this approach, however, which is that the queue’s internal task results array increases in length by one with each task, even though in this case the queue’s results are never triggered. Thus, be careful using this pattern if you really expect the queue to live indefinitely. Alternatively, it might be worth extending Queue’s minimal API to allow tasks to be processed without tracking their return value.

@RichardSlater
RichardSlater / underwater.js
Created Oct 9, 2012
Unity3d Underwater Effect
View underwater.js
//This script enables underwater effects. Attach to main camera.
//Define variables
var underwaterLevel = 7;
//The scene's default fog settings
private var defaultFog;
private var defaultFogColor;
private var defaultFogDensity;
private var defaultSkybox;
@mbostock
mbostock / .block
Last active Jun 11, 2018
Asynchronous Queue
View .block
license: gpl-3.0
@dazza5000
dazza5000 / circle.yml
Last active Jun 23, 2018
CircleCI Android Configuration Template - circle.yml
View circle.yml
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-27-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
You can’t perform that action at this time.