Skip to content

Instantly share code, notes, and snippets.

View technosophos's full-sized avatar
💭
Rust

Matt Butcher technosophos

💭
Rust
View GitHub Profile
@technosophos
technosophos / firefox-open-tab.applescript
Last active May 22, 2023 08:06
Open a Tab in Firefox on macOS with AppleScript
# To run:
# osascript firefox-open-tab.applescript http://technosophos.com
#
# References:
# https://support.mozilla.org/en-US/questions/1130718
# https://stackoverflow.com/questions/3645763/how-do-i-instruct-applescript-to-open-a-new-firefox-window-with-a-link
on firefoxRunning()
tell application "System Events" to (name of processes) contains "firefox"
end firefoxRunning
@technosophos
technosophos / gist:4259125
Created December 11, 2012 15:00
Element creation in QP
<?php
//define('QP_NO_AUTOLOADER', TRUE);
require 'src/qp.php';
function examples_qptest() {
$qp = qp("<?xml version=\"1.0\" encoding=\"UTF-8\"?><root/>");
$i = 0;
while ($i < 200) {
$issuerType = rand() ? 'type1' : 'type2';
$firstName = md5(rand(0,100000));
@technosophos
technosophos / ftc-vscode-linux.md
Last active October 13, 2020 00:01
Installing a VS Code-based development environment for FTC on Linux

Installing a Development Environment for FTC on Linux with VS Code

This documents my attempts to get the First Tech Challenge (FTC) base code running on Linux using VS Code instead of Android Studio. Android Studio is a little too slow and hefty for my liking.

Prerequisites

I am running Ubuntu 18.04. Package names and installation methods will vary on other platforms.

Install JDK

@technosophos
technosophos / kibana.conf
Last active January 11, 2020 21:41
An upstart (Ubuntu 12.04) script for starting Kibana as a service. The file goes in /etc/init/. This goes with the Upstart script for Logstash (http://cookbook.logstash.net/recipes/using-upstart/)
# kibana.conf# kibana - log viewer
#
description "Kibana logstash viewer"
start on virtual-filesystems
stop on runlevel [06]
respawn
respawn limit 5 30
@technosophos
technosophos / Dockerfile
Created September 27, 2019 14:54
Rust Dockerfile hacks for faster builds
FROM rust:1.37 AS builder
WORKDIR /usr/src/buck
COPY Cargo.toml .
COPY Cargo.lock .
# Layer hack: Build an empty program to compile dependencies and place on their own layer.
# This cuts down build time
RUN mkdir -p ./src/ && \
echo 'fn main() {}' > ./src/main.rs && \
@technosophos
technosophos / glide-init-state.txt
Last active July 18, 2018 20:23
Glide init process
@startuml glide-init-state.png
start
:glide init;
:Scan source;
:List deps;
while (read list of deps) is (found dep)
:Find dep;
if (Found) then (yes)
:Add to list;
elseif (Missing dep) then (yes)
@technosophos
technosophos / post-receive.sh
Created November 10, 2017 21:39
Git post-receive hook that creates Brigade event
#!/bin/bash
while read oldrev newrev refname
do
short_sha=${newrev:0:8}
ulid=$(/usr/local/bin/ulid)
build_id="acid-worker-${ulid}-${short_sha}"
e_build_id=$(echo "$build_id" | base64 -w 0)
e_project_id=$(echo "$ACID_PROJECT_ID" | base64 -w 0)
e_acidjs=$(git show ${newrev}:acid.js | base64 -w 0)
@technosophos
technosophos / simple-event.sh
Created December 19, 2017 21:29
Simple Kubernetes Brigade event generator.
#!/usr/bin/env bash
set -euo pipefail
# The Kubernetes namespace in which Brigade is running.
namespace="default"
event_provider="simple-event"
event_type="my_event"
# This is github.com/deis/empty-testbed
@technosophos
technosophos / ulid.go
Created November 16, 2017 21:32
Generate a ULID on the commandline
package main
import (
"fmt"
"math/rand"
"strings"
"time"
"github.com/oklog/ulid"
)
@technosophos
technosophos / helm-ui-guidelines.md
Last active December 1, 2016 23:51
Helm User Interface Design Guidelines

Helm User Interface Guidelines

DRAFT DRAFT DRAFT

This document specifies how to write build a consistent and useable command line client (CLI) that follows the conventions already established in the Helm project.

The Goal Is Obvious

The goal of a good user interface is to make it obvious to the user. This is achieved in three ways: