Skip to content

Instantly share code, notes, and snippets.


Patrick Detlefsen patrickdet

View GitHub Profile
abinavseelan / index.jsx
Created Mar 8, 2018
(Full) Github-style user suggestions using react-input-trigger
View index.jsx
import React, { Component } from 'react';
import { render } from 'react-dom';
import InputTrigger from 'react-input-trigger';
class App extends Component {
constructor() {
this.state = {
top: null,
left: null,
showSuggestor: false,
View sub_server.erl
%% gen_server callbacks
simonh1000 / DragTable.elm
Last active Jun 29, 2017
Draggable table
View DragTable.elm
module DragTable exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode as Json exposing (Decoder, Value)
import Dict exposing (Dict)
import List as L exposing (drop, take)
import Tuple
View types.markdown

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

yang-wei /
Last active May 4, 2022
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !


myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
View elm-binary-tree.elm
sum : Tree Int -> Int
sum tree =
case tree of
Empty -> 0
Node v left right ->
v + sum left + sum right
flatten : Tree a -> List a
flatten tree =
case tree of
tlrobinson / redux-devtools-separate-window.js
Last active Aug 20, 2019
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
View redux-devtools-separate-window.js
// give it a name so it reuses the same window
var win =, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
// reload in case it's reusing the same window with the old content
// wait a little bit for it to reload, then render
setTimeout(function() {
<DebugPanel top right bottom left >
gaearon / combining.js
Created Jun 3, 2015
Combining Stateless Stores
View combining.js
// ------------
// counterStore.js
// ------------
import {
} from '../constants/ActionTypes';
const initialState = { counter: 0 };
staltz /
Last active May 15, 2022
The introduction to Reactive Programming you've been missing
dustinlarimer /
Last active Sep 11, 2018
Keen IO Geo Coordinates in a Google Map