Skip to content

Instantly share code, notes, and snippets.

View adamrenklint's full-sized avatar

Adam Renklint adamrenklint

View GitHub Profile
@adamrenklint
adamrenklint / debugger-demo.core.cljs
Created January 28, 2018 14:48
Not able to inspect state at breakpoint after re-defining function in REPL
; Consider the following code:
(ns debugger-demo.core)
(defn init []
(let [a (+ 1 2 3)]
(js-debugger)))
; Reload the page and let the Dirac REPL connect
; We'll immediately stop at the breakpoint, and by going into the namespace we can inspect the state of the frame at which we have stopped
(defn code-mirror
"Create a code-mirror editor. The parameters:
value-atom (reagent atom)
when this changes, the editor will update to reflect it.
options
:style (reagent style map)
will be applied to the container element
:js-cm-opts
options passed into the CodeMirror constructor
:on-cm-init (fn [cm] -> nil)

Keybase proof

I hereby claim:

  • I am adamrenklint on github.
  • I am adamrenklint (https://keybase.io/adamrenklint) on keybase.
  • I have a public key ASCdqYVY4DQibCDzxkJBOvN1yrrHBdSf5hFqdnrkBnZLKQo

To claim this, I am signing this object:

@adamrenklint
adamrenklint / tmux.md
Created October 14, 2016 13:32 — forked from andreyvit/tmux.md
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

@adamrenklint
adamrenklint / emacs-cheat-sheet.md
Created October 13, 2016 14:14 — forked from dherman/emacs-cheat-sheet.md
Emacs cheat sheet

Rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.

  • C-x C-c - quit
  • C-x C-s - save buffer
  • C-x C-f - open file
  • C-x b buffer name - switch to open buffer
@adamrenklint
adamrenklint / vanilla-1.ts
Created September 16, 2016 13:22
Immutable data structures in TypeScript
import { freeze, assoc } from 'icepick'
interface User {
/**
* Name of the user
*/
readonly name: string
/**
* Age of the user
*/
@adamrenklint
adamrenklint / progress.js
Last active June 3, 2016 08:11
Drawing a progress bar from Dilla's position
var Dilla = require('./index');
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
var dilla = new Dilla(audioContext);
// Setup the standard metronome stuff
var high = {
'position': '*.1.01',
'freq': 440,
'duration': 15
};
import { combineReducers } from 'redux';
function user(state = {}, action) {
switch (action.type) {
case UPDATE_USERNAME:
return {
...state,
name: action.payload
};
}
http://www.trn.gl/bhkr
INDEX/KEY/POSITION
/QFQ(FQ_Q)FS*
0 1Q 1.1.01
1 1F 1.1.49
2 1Q 1.2.01
4 1F 1.2.49
@adamrenklint
adamrenklint / list-select.html
Created October 16, 2014 09:22
Advanced indexed content insertion points with fallback
<wunderland-component attributes="name value values options type prefix_nodes">
<template>
<template repeat="{{val, i in values}}">
<div class="prefix_insertion" id="{{i | attach_prefix_node}}"></div>
<wunderland-select on-change="{{updateValue}}">
<template repeat="{{opt in options}}">
<wunderland-option selected="{{opt == val}}">{{opt}}</wunderland-option>
</template>
</wunderland-select>
<wunderland-button class="remove" context="danger" on-click="{{removeOption}}" index="{{i}}" size="small">Remove</wunderland-button>