Skip to content

Instantly share code, notes, and snippets.

View Delapouite's full-sized avatar

Bruno Heridet Delapouite

View GitHub Profile
# gris theme
evaluate-commands %sh{
c0="rgb:000000"
c5="rgb:555555"
ca="rgb:aaaaaa"
cf="rgb:ffffff"
main="rgb:ff69b4"
echo "
#!/bin/sh
# used by kakoune to use fzf+rg
# sleep needed to get real dimensions
sleep 0.1
COLUMNS=$(tput cols)
LINES=$(tput lines)
# multiply by 2 to roughly approximate the size of a cell
LINES=$(expr $LINES \* 2)
@Delapouite
Delapouite / registers.kak
Last active May 26, 2017 14:54
kak registers
def registers %{ %sh{
echo -n info -title registers -- %{
echo '% ' "$kak_reg_percent"
echo '. ' "$kak_reg_dot"
echo '# ' "$kak_reg_hash"
echo '" ' "$kak_reg_dquote"
echo '@ ' "$kak_reg_arobase"
echo '/ ' "$kak_reg_slash"
echo '^ ' "$kak_reg_caret"
echo '| ' "$kak_reg_pipe"
@Delapouite
Delapouite / hyperscript.md
Created May 26, 2017 10:24
Awesome hyperscript
@Delapouite
Delapouite / tmux-commands.txt
Created May 17, 2017 20:29
tmux commands inverted : noun-verb
tmux list-commands | cut -d' ' -f1 | sed -r 's/([^-]*)-(.*)/\2-\1/' | sort
before-confirm
buffer-choose
buffer-delete
buffer-load
buffer-paste
buffer-save
buffer-set
@Delapouite
Delapouite / bang.js
Created December 28, 2015 09:10
_.templateSettings.import
var _ = require('lodash')
_.templateSettings.imports.bang = x => `${x}!`
var compiled = _.template('<b><%= bang("foo") %></b>')
console.log(compiled())
@Delapouite
Delapouite / logger-middleware.js
Created August 12, 2015 10:54
Currying with ES6 fat arrows
// example taken from redux middleware docs : http://gaearon.github.io/redux/docs/advanced/Middleware.html
// ES5
function logger (store) {
return function (next) {
return function (action) {
console.log('dispatching', action);
var result = next(action);
console.log('next state', store.getState());
return result;
@Delapouite
Delapouite / gist:4bc4dd406a5ccfdbf9b9
Created January 26, 2015 15:17
Reveal.js plugin to make code snippet expendable
// dblclick on a code snippet to display it (almost) fullscreen
// dblclick again to hide it
(function () {
"use strict";
function expand (node) {
node.addEventListener('dblclick', function () {
var clone = node.cloneNode(true);
clone.style.bottom = 0;
@Delapouite
Delapouite / rules-headings
Created June 18, 2014 09:06
Headings used in eslint documentation
ack '^## '
no-control-regex.md
5:## Rule Details
24:## When Not To Use It
no-new.md
9:## Rule Details
no-labels.md