Skip to content

Instantly share code, notes, and snippets.

@tastywheat
tastywheat / dev-tmux.sh
Created May 7, 2019 11:11
tmux start up script
#!/bin/bash
# create session in background, name the session "first"
tmux new-session -d
# echo something
tmux send-keys "echo 'woot woot'" C-m
# name the window "foo"
tmux rename-window "foo"
@tastywheat
tastywheat / docker-compose.yml
Created April 22, 2019 00:20
docker-compose
version: '2'
services:
api:
image: node:10
working_dir: /opt
stdin_open: true
tty: true
volumes:
- ./api:/opt
ports:
@tastywheat
tastywheat / .tmux.conf
Last active October 14, 2022 23:37
tmux conf
# First remove *all* keybindings
unbind-key -a
# Now reinsert all the regular tmux keys
# set-option -g prefix `
# bind-key ` send-prefix
# set-option -g prefix C-b
# bind-key C-b send-prefix
# bind-key C-o rotate-window
# bind-key C-z suspend-client
@tastywheat
tastywheat / .vimrc
Last active June 3, 2024 23:32
vimrc
filetype off
syntax on
" Vundle Install
" launch vim, run :PluginInstall
"
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'christoomey/vim-tmux-navigator'
@tastywheat
tastywheat / bacon-js-batch-async-requests.js
Created March 3, 2017 17:02
bacon js batch async requests
var Bacon = require('baconjs');
var stream = new Bacon.Bus();
function keyF(event) {
return event.url;
}
function limitF(groupedStream, groupStartingEvent) {
@tastywheat
tastywheat / express-proxy-to-webpack-server.js
Created August 14, 2016 00:59
express proxy to webpack server
var app = express();
// proxy the request to webpack server
app.use(proxy(url.parse('http://localhost:3000')));
app.listen(3001, function (err) {
if (err) {
console.error(err);
} else {
console.log('proxy listening on 3001');
}
@tastywheat
tastywheat / fixed-fluid-columns.html
Last active June 17, 2016 20:30
fixed-fluid columns
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
#sidebar {
width:200px;
float:right;
background-color: green;
@tastywheat
tastywheat / code practices
Created June 17, 2016 13:53
code practices
variable/function names - why, not how
functions - tell, don't ask
@tastywheat
tastywheat / load test example
Created June 8, 2016 15:00
load test with apache bench (ab)
ab -n 200 -c 20 -H "Authorization: 123" "http://someurl.com"
@tastywheat
tastywheat / genserver_perpetual_ticker.ex
Last active July 16, 2016 14:57
GenServer perpetual ticker
defmodule ArticleImporter.Server do
use GenServer
def start_link(_args \\ []) do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
end
def init(state) do
:erlang.send_after(1000, __MODULE__, :tick)
{:ok, state}