Skip to content

Instantly share code, notes, and snippets.

View steveliles's full-sized avatar

Steve Liles steveliles

View GitHub Profile
@steveliles
steveliles / approval-1.dot
Created December 10, 2010 19:23
approval-1.dot
digraph {
node [shape=circle,fontsize=8,fixedsize=true,width=0.9];
edge [fontsize=8];
rankdir=LR;
"do" [shape="circle", style="filled", color="green"];
"approved" [shape="circle", style="filled", color="red"];
"do" -> "approval";
@steveliles
steveliles / work-queue-1.dot
Created December 13, 2010 18:01
Work-Queue work-flow pattern diagrams in graphviz dot syntax
digraph {
node [shape=circle,fontsize=8,fixedsize=true,width=0.9];
edge [fontsize=8];
rankdir=LR;
"queue" [shape="doublecircle" color="orange"];
"s1" -> "queue";
"queue" -> "s2";
(function(){var $gwt_version = "2.0.4";var $wnd = window;var $doc = $wnd.document;var $moduleName, $moduleBase;var $strongName = '1D88C1CFC956D9CCF482C24AC7F915B7';var $stats = $wnd.__gwtStatsEvent ? function(a) {return $wnd.__gwtStatsEvent(a);} : null;var $sessionId = $wnd.__gwtStatsSessionId ? $wnd.__gwtStatsSessionId : null;$stats && $stats({moduleName:'rubiks',sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalStart'});function r(){}
function F(){}
function E(){}
function D(){}
function C(){}
function mq(){}
function hb(){}
function vb(){}
function Hb(){}
function Lb(){}
@steveliles
steveliles / dabblet.css
Created December 16, 2011 09:27
Untitled
* {
text-rendering: optimizelegibility;
}
p {
padding:40px;
font-size:20px;
}
code {
@steveliles
steveliles / Example1.java
Created August 29, 2013 08:13
hello, concurrent world!
package concurrency.part1.ch1;
public class Example1 {
public static void main(String[] args)
throws Exception {
new Thread() {
@Override
public void run() {
@steveliles
steveliles / Example2.java
Created August 29, 2013 08:24
hello again, concurrent world!
package concurrency.part1.ch1;
public class Example2 {
public static void main(String[] args)
throws Exception {
Runnable _r = new Runnable() {
public void run() {
System.out.println("Hello again, concurrent world!");
package androidconcurrency.chapter4;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
/**
* Adds support for isChangingConfigurations when minSdkVersion
* targets api-levels below 11.
*
* Unfortunately onSaveInstanceState is invoked AFTER onPause,
@steveliles
steveliles / VerticalViewPager.java
Last active December 23, 2019 23:34
A vertical-paging version of ViewPager - the existing implementations that I found did not work for me. This is a simple hack-up of the standard v4 support ViewPager to convert its horizontal behaviour to vertical.
package com.sjl.views;
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@steveliles
steveliles / Foreground.java
Created April 20, 2014 15:30
Class for detecting and eventing the foreground/background state of an Android app - API-level 14+
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@steveliles
steveliles / Foreground.java
Last active January 22, 2024 18:06
Class for detecting and eventing whether an Android app is currently foreground or background (requires API level 14+)
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;