Skip to content

Instantly share code, notes, and snippets.

View bernerdschaefer's full-sized avatar

Bernerd Schaefer bernerdschaefer

View GitHub Profile
Schema: map[string]*schema.Schema{
"addon": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"app": {
Type: schema.TypeString,
Required: true,
package main
type Options struct {
Input string
Output string
Switch bool
}
func parseFlags(options *Options) {
flag.StringVar(&options.Input, "", "input file")
@bernerdschaefer
bernerdschaefer / leap.ktn
Last active June 18, 2016 20:27
Leap in Kitten
// The exercism "Leap" program in Kitten
// http://exercism.io/exercises/ruby/leap/readme
// http://kittenlang.org/
1996 isLeapYear "1996 is a leap year" assert
1997 isLeapYear "1997 is not a leap year" refute
1998 isLeapYear "1998 is not a leap year" refute
1900 isLeapYear "1900 is not a leap year" refute
1800 isLeapYear "1800 is not a leap year" refute
2400 isLeapYear "2400 is a leap year" assert
#!/bin/sh
while true; do
battery=`cat /sys/class/power_supply/BAT0/capacity`
time=`date +"%H:%M"`
xsetroot -name "${battery}% | ${time}"
sleep 30
done
#!/usr/bin/env bash
#
# DEPENDENCIES:
# bynanz
# xdotool
echo | dmenu -p "Enter to set X/Y start"
eval $(xdotool getmouselocation --shell)
STARTX=$X
@bernerdschaefer
bernerdschaefer / inputrc.patch
Created January 8, 2016 19:41
Turn off arrow keys anywhere inputrc is respected
diff --git a/inputrc b/inputrc
index c9d1b79..36d91cd 100644
--- a/inputrc
+++ b/inputrc
@@ -2,3 +2,7 @@
"\e[B": history-search-forward
"\C-p": history-search-backward
"\C-n": history-search-forward
+"\e[A": ""
+"\e[B": ""
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# Activate the gem you are reporting the issue against.
class << self
alias mess_with_bernerd define_method
end
eval(<<-EOS)
mess_with_bernerd(:foo) do
puts "but can you handle string eval???"
end
mess_with_bernerd(:bar) do
class << self
alias mess_with_bernerd define_method
end
mess_with_bernerd(:foo) do
#
#
#
end
" clone github.com/fatih/vim-go into /tmp, and run vim
" with `vim -u path-to-this-file` to test out the plugin.
set nocompatible
syntax on
filetype plugin indent on
" add vim-go plugin to runtime path
set rtp+=/tmp/vim-go