Skip to content

Instantly share code, notes, and snippets.

View tjstebbing's full-sized avatar
🐝
.go .py .js .vim

Timothy Stebbing tjstebbing

🐝
.go .py .js .vim
View GitHub Profile
set-option -g default-shell /bin/zsh
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h

Hi, this is a cockrel route definition. Each route is a markdown file, each section like this one is a cockrel 'step'. Text blocks like this one are comments, while section headers provide step instructions. code blocks are evaluated as javascript and run.

Click here to see what this looks like raw.

This file is literally a declaration of your route handler. It calls a few services and returns a result. I've left out error handling for brevity but you cansee how that works by reading the Cockrel Documentation.

Change node version for current project.

This is a little ZSH function that hooks change cwd and checks for our ./deployment.json it then uses nvm to change the current node version to the one required by the project.

Install deps

  • jq
  • nvm
dCd)maGAQe2fsKEnvsntvuuZMQUjsu3wODkO9c7wI9RkOFQk0Wqs)gPgQkkYGvrPHRsoOkkWPL6ye5CQWcvrESalMkrlxv9qvu5POwMi9CenrvuOPsyYimDLlQIc6Ws6zIkxNuBejSoKi2mjTDIQ)sugNi6ZK47uj5sQcmnQy0IQgVQOtQIQUfvQRjkNxe(MQ0LPSnvQHeeGRqGbMeCkLMsPsuAg4iycWeqaMOjDHUeSwUbU69G)MstxejUmWkFA9f4AWA5M43kk2NY0egcDlrf8ZhvvjTbkC)(MLuk74its6(1jPeuD74aUjaN3(UKemP5vpt0DzGp9Oq8iLpZNHuiax0rXVvuSpjcLaN4rvvsBGc3oz3zs3hz3huPML9sfQUDYb2txjGa8QERmiah1(1qGHbwtAYc8vss4sWFAVbb4O2VgcmmWxYVw1BLbb4O2VgcmmWQ1G10fiah1(1qGHbMOvv7aTFjGaCu7xdbgg4FnWGaCu7xdbgggy75vTqye4eg4aiqOeeGjAYlFnHWEoWFk5bxG)MstxejUmWZEoW1G1YnXVvuSpLPjme6wIk4U0twaD8YBZiqOe4AWA6cjeGjx9piatqltXt7k4sWe0YIgjzvXGlbtqlJKwxiGlXa3LEqaMGwwGMC0r4smmWenPl0LG1YnWvVhCta(ttAG1L9Bff7db4EwmSgnekL6irnddSRAILhuClDK6K5Kt6W5n92HkuD7Ke8ZhvvjTbkULosDYCYjD48MElLdQUDoax0rXVvuSpjcLaN3AL8duC)MLL744499i9(o7gQUDoa7PReqaEvVvgeGJA)AiWWat0QQDG2VeqaoQ9RHadd8N2BqaoQ9RHadd8L8Rv9wzqaoQ9RHadd8VgyqaoQ9RHaddSAnynDbcWrTFneyyyG3VvuSpeGxIldm5QttcwtAYcO1LbxcwtAY6zXWA0WjWAstwxc8Ac7uT4ACcSUyYTYax1JgSM0KPl9WjW9SyynAiuk1rIAgytUvg4Zpl(WZEoADzGd0
const fs = require('fs');
const path = require('path');
const ped = require('pedestrian');
// +---------------------------------------------------------------------+ //
// Pat, edit these two variables
const inputDir = 'components';
const outputDir = 'output';
function flatten(slices) {
let out = {};
for(s in slices) {
let slice = slices[s];
Object.keys(slice).forEach(k => {
if(!out.hasOwnProperty(k)) {
out[k] = slice[k] || -1; // force -1 for first-seen 0
} else if(slice[k] !== 0) {
out[k] = slice[k];
}

Original state:

   AARON
          -Lineage of Ex 6:16-20; Jos 21:4,10; 1Ch 6:2,3; 23:13

          -Marriage of Ex 6:23

          -Children of Ex 6:23,25; 1Ch 6:3; 24:1,2

Cockrel.js

Cockrel

Cockrel is a tool for building API routes ontop of micro-services and other things in your environment. It is plugin extensible and has a strong focus on durability via configurable queues.

Think of Cockrel as the glue between your wonderfully isolated intranet of things.

mdless

Read markdown files in your terminal

cd ~/code
git clone [email protected]:axiros/terminal_markdown_viewer.git
cd terminal_markdown_viewer
pip install markdown pygments pyyaml
/*
This is a concept for a pipeline configuration language which assembles
a router/queue processor that streamlines service routing for API endpoints.
This allows you to create backend service APIs as mixable black-box components,
they may be API services written in any language, they may be AWS Lambdas, it
doesn't really matter.
This is achieved as a simple tagged function using javascript string literals,