Skip to content

Instantly share code, notes, and snippets.

View bbuck's full-sized avatar
💻
working hard

Brandon Buck bbuck

💻
working hard
View GitHub Profile
@bbuck
bbuck / Nord.yaml
Created April 3, 2023 20:54
Nord theme (ripped from part of the Nord iterm theme) for the Warp terminal (https://warp.dev).
accent: "#d9dde7"
background: "#2f333e"
foreground: "#d9dde7"
details: "darker"
terminal_colors:
normal:
black: "#3c4150"
red: "#b2656b"
green: "#a8bd90"
yellow: "#e5cc93"
package pool
// StateMutator will modify an LState before it goes into the pool. This can
// run any number of scripts as necessary such as registring libraries,
// executing code, etc...
type StateMutator func(*lua.LState)
// PooledState wraps a Lua state. It's purpose is provide a means with which
// to return the state to the StatePool when it's not longer being used.
type PooledState struct {
@bbuck
bbuck / cipher.hs
Last active July 5, 2017 18:32
Caeser cipher written as part of a Chapter 9 challenge in the Haskell Book: http://haskellbook.com/
module Cipher where
import Data.Char
clampAlpha :: (Integral a) => a -> a
clampAlpha = (`mod` 26)
lowerBound :: Char -> Char
lowerBound c
| isUpper c = 'A'
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
# This is the challenge -- you should figure out what you
# don't know here.
class Calculator
class << self
def exit_command(cmd = nil)
if cmd.nil?
@exit_command || "exit"
else
@exit_command = cmd
@bbuck
bbuck / erb_string.rb
Last active February 4, 2016 19:47
Ruby ERB String Extensions
require 'erb'
class ERBContext
def initialize(hash)
hash.each_pair do |key, value|
singleton_class.send(:define_method, key) { value }
end
end
def get_binding
{
"Variables": {
"me": "bbuck",
},
"GlobalOptions": {
"User": "{{me}}"
},
"Groups": [
{
"GroupName": "jumpshells",
@bbuck
bbuck / man.sh
Last active November 24, 2015 19:21 — forked from lkptrzk/man.sh
`man` replacement for git bash on windows
#!/bin/sh
# man.sh - `man` replacement for git bash on windows
# Dependencies (outside of git bash):
# curl (already available in git bash)
# Notes:
# `curl s` = non-verbose output
#
mutation _ {
newTodo: createTodo(text: "This is a todo mutation example") {
text
done
}
}
@bbuck
bbuck / bufio_conv_solution.go
Last active December 20, 2020 23:00
Solutions to a hacker rank problem demonstrating slowness in Go.
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {