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
@shekibobo
shekibobo / README.md
Last active Feb 9, 2020
Android: Base Styles for Button (not provided by AppCompat)
View README.md

How to create custom button styles using Android's AppCompat-v7:21

Introduction

AppCompat is an Android support library to provide backwards-compatible functionality for Material design patterns. It currently comes bundled with a set of styles in the Theme.AppCompat and Widget.AppCompat namespaces. However, there is a critical component missing which I would have thought essential to provide the a default from which we could inherit our styles: Widget.AppCompat.Button. Sure, there's Widget.AppCompat.Light.ActionButton, but that doesn't actually inherit from Widget.ActionButton, which does not inherit from Widget.Button, so we might get some unexpected behavior using that as our base button style, mainly because Widget.ActionButton strictly belongs in the ActionBar.

So, if we want to have a decently normal default button style related to AppCompat, we need to make it ourselves. Let's start by digging into the Android SDK to see how it's doing default styles.

Digging In

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:

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;
@donnfelker
donnfelker / android-19-circle.yml
Last active Oct 3, 2019
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:
@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');
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:
@korya
korya / Subfolder to git repo.md
Last active Feb 4, 2020
Convert subfolder into Git submodule
View Subfolder to git repo.md
@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.

@nasirkhan
nasirkhan / git command.markdown
Last active Feb 18, 2020
`git` discard all local changes/commits and pull from upstream
View git command.markdown

git discard all local changes/commits and pull from upstream

git reset --hard origin/master

git pull origin master

@mbostock
mbostock / .block
Last active Oct 29, 2019
Collapsible Tree
View .block
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-collapsible-tree
You can’t perform that action at this time.