Skip to content

Instantly share code, notes, and snippets.

View travisjupp's full-sized avatar

tjupp travisjupp

View GitHub Profile
@TooTallNate
TooTallNate / bbs.js
Created March 16, 2012 22:42
Running a node.js REPL over `curl`
/**
* Requires node v0.7.7 or greater.
*
* To connect: $ curl -sSNT. localhost:8000
*/
var http = require('http')
, repl = require('repl')
, buf0 = new Buffer([0])
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@romainl
romainl / gist:9970697
Last active June 16, 2025 13:04
How to use Tim Pope's Pathogen

How to use Tim Pope’s Pathogen

I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea

Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

@aq1018
aq1018 / api_example.rb
Created December 8, 2014 19:44
NationBuilder API Example
require 'net/http'
require 'json'
class APIClient
class Error < RuntimeError; end
class ClientError < Error; end
class ServerError < Error; end
def initialize(host, token)
@host, @token = URI(host), token
@filipelinhares
filipelinhares / vim.md
Last active August 10, 2025 23:09
Vim basic commands

Vim basic commands

A

  • a Enter into insert mode after the character your cursor is on.
  • A Enter into insert mode at the end of the current line.

B

  • b Move cursor to first character of previous word.
  • B Move cursor to first character of previous non-blank series of characters.
  • Ctrl+b Scroll page backwards (move up in the file).
@bbqtd
bbqtd / macos-tmux-256color.md
Last active August 10, 2025 14:37
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@rstacruz
rstacruz / README.md
Last active July 20, 2025 08:25
Setting up Jest with ESM

Setting up Jest with ESM

Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.

Method A: Native Node.js support

Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules flag.

Install cross-env:

Add more features [advanced]

At some point you might get limited by the Queue class as a data-structure. You have to add methods for new features, that break the definition of a Queue.

  • Multi threaded dequeue(): Maybe you want to break the limit of "one request after the other". E.g. run up to max 5 tasks parallel. You can replace this._pendingPromise (true|false) flag with a counter and check insinside dequeue().

async dequeue() {

@travisjupp
travisjupp / zle-widgets-with-default-keybindings.md
Last active August 30, 2025 11:58
Short summary of all standard ZLE widgets with keybindings

Zsh ZLE Standard Widgets — Default Key Bindings (Zsh 5.9) and Bash Readline Equivalents

This list gives all standard widgets (including those with and without default keybindings), a short summary, and the default key(s) for each, as found in Zsh 5.9 (emacs and vi modes).
Where available, the equivalent Bash Readline function and default keybinding are shown as Ctrl-X (Bash Readline).
Widgets with no default keybinding are listed without a key.
Third-party/community/user widgets (e.g. fzf, npm, z4h, bash*) are also listed when requested, but are not present in default zsh.


  • accept-and-hold