Skip to content

Instantly share code, notes, and snippets.

View john-stemberger's full-sized avatar

John S john-stemberger

View GitHub Profile
/*
* Copyright 2017, 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
*
* Unless required by applicable law or agreed to in writing, software
@john-stemberger
john-stemberger / TrueTimeExt.kt
Created March 20, 2020 20:26
True Time Re-initilize for dealing with clock drift
package com.instacart.library.truetime
import com.instacart.library.truetime.TrueTime.saveTrueTimeInfoToDisk
fun TrueTime.reInitialize(ntpHost: String) {
withNtpHost(ntpHost)
if (!TrueTime.isInitialized()) {
initialize()
} else {
requestTime(ntpHost)
# put the following into the .girconfig file
[alias]
# Common commands
lg = log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
llg = log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --author='John Stemberger'
f = fetch --prune --all
# Normalize listing
branches = branch -a
@john-stemberger
john-stemberger / gist:ac09e0694195f2b2a6e3a880ffc81a35
Created May 10, 2016 20:07
helpful gradle scripts for verifying android translations
def printNode(Node xml) {
def s = new StringWriter()
PrintWriter printWriter = new PrintWriter(s);
XmlNodePrinter printer = new XmlNodePrinter(printWriter, " ");
printer.preserveWhitespace = true
printer.print(xml)
return s.toString();
}