Skip to content

Instantly share code, notes, and snippets.

View kyleburton's full-sized avatar

Kyle Burton kyleburton

View GitHub Profile
@kyleburton
kyleburton / google-sheet-script.js
Created August 30, 2019 23:01
counting colored cells in google sheets
// =countbackgrounds("C2:K2","#00ff00")
/*
it's a bit of a hack to send in the cell range as a string, though it works when calling getRange:
SpreadsheetApp.getActiveSpreadsheet().getRange(range)
This also means you can't "fill down" to have the ranges updated to match your sheet, so hack number two genreates
the formulas so you can copy/paste them into the sheet:
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
/*
* Don't cheat!
*
* javac Foo.java && java Foo
*
*/
public class Foo {
public static void main (String [] args) {
System.out.println("option1\n\n");
public class Test {
public static String evenOrOdd(int val) {
if (0 == (val % 2)) {
return "even";
}
return "odd";
}
public static String evenOrOdd(long val) {
if (0 == (val % 2)) {
return "even";
@kyleburton
kyleburton / az
Last active April 11, 2022 05:16
linux project launcher (eg: az/ht)
#!/usr/bin/env bash
set -eEu -o pipefail
# set -x
WORKSPACES="project-web project-admin cider-scratchpad lambda-handler api-tests terraform cypress-web cypress-admin"
COMMANDS="urls reset gist shutdown stop workspaces commands all"
function workspace-name-for-abbreviation {
case "$1" in
#!/usr/bin/env bash
set -eEu -o pipefail
# set -x
WORKSPACES="project-web project-admin cider-scratchpad lambda-handler api-tests terraform project-web-tests project-admin-tests"
COMMANDS="urls reset gist shutdown stop workspaces commands all"
function workspace-name-for-abbreviation {
case "$1" in