Skip to content

Instantly share code, notes, and snippets.

@anka-213
anka-213 / SketchSystems.spec
Last active April 14, 2020 16:08 — forked from ryanlucas/SketchSystems.spec
Animated Button
Animated Button
Go
click -> Loading
Loading
successful -> Success
failure -> Error
Success
reset -> Go
Error
reset -> Go
@anka-213
anka-213 / SketchSystems.spec
Last active April 14, 2020 16:00 — forked from rgraves-aspiration/SketchSystems.spec
Aspiration App Logic
Aspiration App Logic
open app from home screen -> Has User Previously Logged In?
Logged Out Flow
Has User Previously Logged In?
yes -> Is Device Authentication Set Up?
no -> App Welcome Screen
App Welcome Screen
tap login -> Is Device Authentication Set Up?
@anka-213
anka-213 / MemoFunctions.hs
Created November 19, 2018 15:08
A module for converting functions into concrete algebraic data structures
{- |
This module gives a direct representation of concrete functions as
algebraic data structures.
> show not
>>> (False => True) :++: (True => False)
> show (&&)
>>> (False => ((False => False) :++: (True => False)))
@anka-213
anka-213 / Goto.hs
Created April 15, 2018 23:12
A version of http://d.hatena.ne.jp/fumiexcel/20121111/1352624678 that protects against labels escaping an invocation of runGotoT
{-# LANGUAGE RankNTypes #-}
import qualified Data.IntMap as M
import Control.Monad.Trans.Free
import Control.Monad.Trans
{-
The phantom parameter s protects labels from escaping an invocation of runGotoT.
For example, this program:
invalid = runGotoT label >>= runGotoT . goto
is rejected at compile time with this version, but crashes
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
// ==UserScript==
// @name Copy LOL item-set
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Adds a button for copying the item set.
// @author You
// @match http://lol.item-set.com/*
// @grant none
// ==/UserScript==
@anka-213
anka-213 / surfingkeys.js
Created June 15, 2017 18:39 — forked from karlredman/surfingkeys.js
my surfingkeys.js (google chrome surfingkeys extension configuration)
// an example to create a new mapping `ctrl-y`
/*
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
*/
// an example to replace `u` with `?`, click `Default mappings` to see how `u` works.
map('?', 'u');
@anka-213
anka-213 / surfingkeys.js
Last active June 15, 2017 19:06 — forked from karlredman/surfingkeys.js
my surfingkeys.js (google chrome surfingkeys extension configuration)
// My settings:
if (window.location.origin === "https://www.duckduckgo.com") {
unmap('h');
unmap('j');
unmap('k');
unmap('l');
}
@anka-213
anka-213 / Simple Brainfuck interpreter.py
Created May 22, 2017 12:31
Simple Brainfuck interpreter created by andreaskällberg - https://repl.it/IKt3/2
def get_dir(c):
# return 1 if c == '[' else -1 if c == ']' else 0
dirs = {'[':1, ']': -1}
return dirs[c] if c in dirs else 0
class Code:
code = ""
pc = 0
def __init__(self, code):
self.code = code
@anka-213
anka-213 / Simple Brainfuck interpreter.py
Created May 22, 2017 12:01
Simple Brainfuck interpreter created by andreaskällberg - https://repl.it/IKt3/1
from collections import defaultdict
def get_dir(c):
# return 1 if c == '[' else -1 if c == ']' else 0
dirs = {'[':1, ']': -1}
return dirs[c] if c in dirs else 0
class Code:
code = ""
pc = 0