Skip to content

Instantly share code, notes, and snippets.

View frontrangerider2004's full-sized avatar

FrontRangeRider frontrangerider2004

  • Colorado
  • 04:11 (UTC -06:00)
View GitHub Profile
SCRIPT_NAME="$(basename -- "$0")"
ABS_SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
####################################################################
# setAbsolutePathofDirectory
#
# PARAMS: directory, String
# cd's into the directory and prints the dir name, then cd's back.
####################################################################
function setAbsolutePathofDirectory {
###############################################################################
# generateOutputFilename
#
# Get a unique timestamped filename with the date, git hash, and branch to
# patch. The stanza is <userPrefix>-date-hash-for-<branch>.patch
#
# NOTE: Date formate is ddmmyy_hhmmss in 24hr format
# NOTE: Git hash is the last 7 chars
###############################################################################
function generateOutputFilename {
#!/bin/bash
####################################################################
# Bash Script Template
# Extend this template to produce a custom bash script that can
# only be run as root, makes temp dirs, and handles ungraceful
# exits by using trap. The script also demonstrates how to accept
# command line arguments.
# NOTE: The run-as-root requirement can easily be removed.
####################################################################
@frontrangerider2004
frontrangerider2004 / IntentServiceStatusReceiver.java
Last active June 13, 2016 19:33
Shows a robust way to get work off the UI thread in Android. Runs a Linux cmd in another thread.
package com.frontrangerider.SubProcess;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import com.frontrangerider.intents.MyIntentActions;
import com.frontrangerider.intents.MyIntentExtras;
import com.frontrangerider.util.Logger;
package com.frontrangrider;
import android.util.SparseArray;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
public enum KeyValueEnum {
FIRST(1, "FIRST"),
import android.util.Log;
/**
* Android Logger Util:
* Handles making nice pretty debug statements.
*/
public class Logger {
private final String TAG;
private final Boolean DEBUG = true; //TODO get this from BuildConfig
private final Boolean WARN = true; //TODO get this from BuildConfig
@frontrangerider2004
frontrangerider2004 / Project Structure
Last active December 4, 2015 14:55
Bare-bones example of using <chart-bar> in a custom wrapper that holds data.
.
├── app
│   ├── my-chart.html
│   └── polymer-app.html
|
└── FrontEnd
└── bower_components
├── chart-elements
├── Chart.js
├── polymer
@frontrangerider2004
frontrangerider2004 / chart-bar.html
Created December 3, 2015 23:50
chart-bar suggested fix for not rendering
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="chart-js-import.html">
<link rel="import" href="dataset-properties-behavior.html">
<link rel="import" href="context-behavior.html">
<link rel="import" href="resize-behavior.html">
<link rel="import" href="chart-styles.html">
<dom-module id="chart-bar">
<template>