Skip to content

Instantly share code, notes, and snippets.

View rudle's full-sized avatar
🖱️
extremely online

human person rudle

🖱️
extremely online
  • San Francisco
View GitHub Profile
@rudle
rudle / Dockerfile
Created December 8, 2021 01:01
I expect this to work, but it doesn't
FROM varnish
RUN apt update -y && apt install -y build-essential automake curl libtool git
RUN curl -s https://packagecloud.io/install/repositories/varnishcache/varnish60/script.deb.sh
RUN apt install -y varnish-modules
package main
import "k8s.io/kubernetes/pkg/labels"
func main() {
_, err := labels.Parse(labels.Nothing().String())
if err != nil {
panic("test failure")
}
}
(defun dotspacemacs/user-config ()
(setq org-capture-templates (quote (("tw" "to do [WORK]" entry (file+headline "~/Dropbox/org/work.org" "Work Todo")
"* TODO %^{Brief description} %^G
%?
SCHEDULED: %t
%a
"))))
)
class ChordSpeller {
constructor(chordView) {
if (this.chordView === null) {
alert("no chordview accessible");
}
this.chord = {};
this.scope = this;
}
var ChordSpeller = {
chord: {}, // this represents the cord the user is holding down. map[string] -> int
chordView: null, // cached chord view
self: this,
init: function() {
console.log("requesting MIDI access");
if (navigator.requestMIDIAccess) {
navigator.requestMIDIAccess({
sysex: false
}).then(ChordSpeller.onMIDISuccess, ChordSpeller.onMIDIFailure);
@rudle
rudle / git-fixup
Created February 17, 2015 02:44
git-fixup
#! /usr/bin/env ruby
staged_files = Array(`git diff --name-only --cached`.split("\n"))
puts "staged files are: #{staged_files}"
staged_files.each do |file|
sha_to_fixup = `git log -n1 --format=%h #{file}`.gsub(/\s*/, '')
# assert sha has not been merged
fail "no commit to fixup in this topic branch" if `git branch --contains #{sha_to_fixup}`.split("\n").any? { |branch| branch =~ /\s*master\s*/ }
puts sha_to_fixup
`git commit --fixup #{sha_to_fixup}`
@rudle
rudle / read.c
Last active August 29, 2015 14:00
#include <string.h>
#include <stdio.h>
#include <zmq.h>
#include <assert.h>
int main (int argc, char ** archv) {
void * context = zmq_init(1);
void *socket = zmq_socket (context, ZMQ_SUB);
assert (socket);
@rudle
rudle / add-align.patch
Created September 9, 2013 03:34
maximum-awesome patches
diff --git a/vimrc.bundles b/vimrc.bundles
index 9e9a983..829977c 100644
--- a/vimrc.bundles
+++ b/vimrc.bundles
@@ -32,6 +32,7 @@ Bundle 'tpope/vim-unimpaired'
Bundle 'tpope/vim-vividchalk'
Bundle 'uarun/vim-protobuf'
Bundle 'vim-ruby/vim-ruby'
+Bundle 'vim-scripts/align.vim'
Bundle 'vim-scripts/greplace.vim'
@rudle
rudle / gist:5234198
Created March 25, 2013 00:19
Date.strftime, Date.strptime don't commute
Date.today.strftime('%-m%-d%y') # 3242013
Date.strptime('3242013','%-m%-d%y') # ArgumentError: invalid date