Skip to content

Instantly share code, notes, and snippets.

View adaam2's full-sized avatar

Adam Bull adaam2

View GitHub Profile
@adaam2
adaam2 / tea.go
Last active October 28, 2022 22:31
package testing
import (
"fmt"
"strings"
"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
)
package testing
import (
"fmt"
"strings"
tea "github.com/charmbracelet/bubbletea"
)
type UITestCase struct {
@adaam2
adaam2 / samproject.md
Last active September 23, 2020 16:08

Intro

I want you to build a Rails API that helps a logistics company to manage their fleet of vehicles.

The company has many depots around the UK, and each depot has a set of vehicles that serve the depot.

Entities

You will be responsible for modelling the entities and their relationships above.

@adaam2
adaam2 / .zshrc
Last active December 9, 2019 17:47
#
# Executes commands at the start of an interactive session.
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
COMPLETION_WAITING_DOTS="true"
set -g default-terminal "screen-256color"
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
" Modeline and Notes {{{
" DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
" Version 2, December 2004
"
" Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
"
" Everyone is permitted to copy and distribute verbatim or modified
" copies of this license document, and changing it is allowed as long
" as the name is changed.
"
# Docker
alias dc="docker-compose"
# Aliases to code folders
alias cde="cd ~/Code"
alias fees="cd ~/Code/consumer-fees"
# Golang
# alias go="richgo"
shell:
program: /bin/zsh
args:
- -l
- -c
- "tmux ls && read tmux_session && tmux attach -t ${tmux_session:-default} || tmux new -s ${tmux_session:-default}"
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
const courses = {
starters: ["🍔", "🍐", "🍅"],
mains: ["🍏", "🍊"],
desserts: ["🍰", "🍓"]
};
const dishesChefCanMake = ["🍏", "🍅", "🍐", "🍔"];
// for each of the courses, find the dishes that the chef can make
// and print them out like so:
@adaam2
adaam2 / IRepository.cs
Last active July 23, 2018 12:49
Basic IRepository
public interface IRepository<T> where T : class
{
T Find(int id);
List<T> All();
void Delete(int id);
void Update(T obj);
}