Skip to content

Instantly share code, notes, and snippets.

@johanneslumpe
johanneslumpe / callModifierForSelectedBlocks.js
Last active February 23, 2022 13:54
Draft.js utilities to inspect/modify selected block ranges
import { EditorState, SelectionState } from 'draft-js';
import getSelectedBlocks from './getSelectedBlocks';
/**
* Calls a provided `modifier` function with a selection for each
* selected block in the current editor selection. Passes through additional
* arguments to the modifier.
*
* Note: At the moment it will retain the original selection and override
@staltz
staltz / introrx.md
Last active May 28, 2024 17:42
The introduction to Reactive Programming you've been missing
@paulirish
paulirish / gist:5558557
Last active April 18, 2024 14:32
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@mxriverlynn
mxriverlynn / 1.js
Created May 4, 2012 14:40
ajax command wrapper
var signForm = $.ajax({
type: "POST",
url: "/some/form",
dataType: "JSON",
data: myData
});
signForm.done(function(response){
// handle success here
});
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000