Skip to content

Instantly share code, notes, and snippets.

View jbritton's full-sized avatar

Jeff Britton jbritton

View GitHub Profile
@jbritton
jbritton / async.cljs
Created September 22, 2020 05:13 — forked from alehatsman/async.cljs
ClojureScript throttle and debouce functions
(ns async
(:import [goog.async Throttle Debouncer]))
(defn disposable->function [disposable listener interval]
(let [disposable-instance (disposable. listener interval)]
(fn [& args]
(.apply (.-fire disposable-instance) disposable-instance (to-array args)))))
(defn throttle [listener interval]
(disposable->function Throttle listener interval))

tmux

Overview

  • tmux is a great solution for managing the state of terminal sessions. This allows you to jump between terminal sessions with ease so you can multitask while not losing your work. In addition, the window and pane display functionality allows you to create dashboard-like layouts for your terminal sessions.
  • tmux is based around sessions. Sessions can be created, attached, and detached. This allows you to create sessions, detach from them, and reattach to them to pick up where you left off.
  • tmux sessions have a zero-indexed number associated with them. This serves as a identifier that's used to reattach to an existing session. They can also be named to give context.
  • tmux windows are contained within a session. A session can have one or many windows. A window is a grouping of panes. Like sessions, windows are also numbered or nameable.
  • tmux panes can be used to run commands, monitor processes, tail logs, etc.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jbritton
jbritton / atom_clojure_setup.md
Created May 16, 2018 13:33 — forked from jasongilman/atom_clojure_setup.md
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@jbritton
jbritton / angularjs_directive_attribute_explanation.md
Created January 11, 2018 21:51 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@jbritton
jbritton / emacs-reference.md
Last active October 15, 2017 16:48
emacs-reference

Emacs Overview

Anatomy of Emacs

  • Menu Bar - top application menu bar containing common File, Edit, Options, Buffers, Tools related tasks
  • Tool Bar - quick tasks for file editing
  • Main Window - the main area, displaying the text editor
  • Mode Line - gives information about the current line, etc.
  • Mini Buffer - allows commands to be typed
  • Fringe - side gutter showing line wraps, etc.
@jbritton
jbritton / graphql-cheat-sheet.md
Last active January 4, 2024 21:46
GraphQL Cheat Sheet

GraphQL Cheat Sheet

Overview

  • An alternative approach to RESTful APIs
  • Clients issue queries/mutations to read and update data
  • Clients can fetch only the entity fields that are required
  • GraphQL query syntax can express complex entity relations => nested objects
  • Mitigates the explosion of RESTful endpoints in scenarios where many different representations of an entity are needed
  • Graphiql is a query execution UI, also provides good documentation
@jbritton
jbritton / gist:682f43fa6e549c62b094
Created July 1, 2015 18:59
Extending L.ImageOverlay to add the layer to the tile pane instead of the overlay pane
var TileImageOverlay = L.ImageOverlay.extend({
onAdd: function (map) {
this._map = map;
if (!this._image) {
this._initImage();
}
// NOTE: adding to tilePane instead of overlayPane
map._panes.tilePane.appendChild(this._image);