Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

  • Clover Food Lab
View GitHub Profile
@selfsame
selfsame / rnn.py
Created September 19, 2018 19:26
textgenrnn utility scrips
import sys, os, re
import pprint
from util import *
import re
from textgenrnn import textgenrnn
textgen = textgenrnn()
def gen(cnt="10", temp="1.0"):
textgen.generate(int(cnt), temperature=float(temp))
@selfsame
selfsame / store.js
Last active May 24, 2018 18:43
generic react-redux store actions
import { createStore } from "redux"
const deepcopy = (col) => {
return JSON.parse(JSON.stringify(col))}
const shallowcopy = (col) => {
return Array.isArray(col)?[...col]:{...col}}
const update = (col, k, f) => {
col = shallowcopy(col)
import { createStore } from "redux"
const shallowcopy = (col) => {
if (Array.isArray(col)) {
return [...col]}
else {
return {...col}}}
const assoc = (col, k, v) => {
col = shallowcopy(col)
selfsame@box ╺─╸ [macplus]
[21:58] >> identify -verbose monoeye.pict
Image: monoeye.pict
Format: PICT (Apple Macintosh QuickDraw/PICT)
Class: DirectClass
Geometry: 507x311+0+0
Resolution: 72x72
Print size: 7.04167x4.31944
Units: Undefined
Colorspace: sRGB
[data]
Game entities are hashmaps.
{:id 5
:hp {:max 100 :current 50}
:sentient true
:name "frog"
:color :green}
@selfsame
selfsame / ideas.md
Created February 15, 2018 19:45
tilde.town platformer

Users claim coordinates of a "room", and define the layout with ascii

#location
5,7

#layout
 |  $ _/
_| _ _=
@selfsame
selfsame / WITCH.md
Last active February 5, 2018 11:01

ideas for tildemush's WITCH scripting language

Let's imagine an Alice and Wonderland themed little cake.

A MUD has a complex system of commands that interact with objects. A player typing eat the little cake would be parsed into the eat command, find a little cake object in the current scope, check for an eatable property, and enact some result, either a default player.name+"eats the"+subject.name or some custom interaction provided by the object.

A MUSH is a "shared hallucination", we avoid hard coded rules and interactions and let the users roleplay as they see fit. A player could /do eats the little cake, /do shrinks down to the size of a mouse!, and then go about pretending to be a tiny person until they got bored.

A WITCH script describes an object which can then be created in the MUD by users. How can these objects facilitate user defined interaction? The current spec has a hears directive giving access to text i

@selfsame
selfsame / AoC.md
Last active December 7, 2017 16:55

Day 1

{+/×2=\2(()[1]) , (1),''} {,[1]} {-48} ⎕UCS

{+/×=()(()÷2)(,)} {-48} ⎕UCS

Day 2

(def words (string/split (slurp "/usr/share/dict/words") #"\n"))
(def words-trie
(reduce
(fn [trie word]
(assoc-in trie (vec (cons (count word) word)) {}))
{} words))
(defn keys-in [tree]
(if (map? tree)