Skip to content

Instantly share code, notes, and snippets.

@WuTheFWasThat
WuTheFWasThat / sortable.jsx
Created July 30, 2016 04:12
Sortable: Drag-to-reorder list
// I wrote this for work today after being unable to find a sortable list API for react to my liking
// Beware: It's only been tested for my use case
// Based largely off of https://github.com/danielstocks/react-sortable/blob/master/src/SortableComposition.js
export default class Sortable extends React.Component {
static get propTypes() {
return React.PropTypes.shape({
items: React.PropTypes.array.isRequired,
updateState: React.PropTypes.func.isRequired,
// template should respect *inherits*
# Stubs for pyrsistent (Python 3.6)
#
from typing import Dict, TypeVar, Generic, Iterable, Optional, Any, Union, Sequence
# PMap
K = TypeVar('K')
V = TypeVar('V')
class PMap(Generic[K, V], object):
def set(self, key: K, val: V) -> PMap[K, V]: ...
@WuTheFWasThat
WuTheFWasThat / triumvirate.lua
Last active April 28, 2018 17:26
triumvirate.lua
local villa = { o = "stone", t = "stonetop", ["8"] = "stucco",
["7"] = "arch_l", ["9"] = "arch_r", ["1"] = "stonebottom_l", ["3"] = "stonebottom_r",
["|"] = "pillar", ["T"] = "pillartop", ["/"] = "grasspillar",
[">"] = "shadowtop_l", ["}"] = "shadow_l", ["<"] = "shadowtop_r", ["{"] = "shadow_r",
["x"] = "ivy_a", ["X"] = "ivy_b", ["+"] = "ivy_c",
["$"] = "hang_a", ["%"] = "hang_b", ["&"] = "hang_c",
["#"] = "bush_a", ["@"] = "bush_a",
[","] = "grass_a", [":"] = "grass_b", [";"] = "grass_c",
["-"] = "ledge" }