Skip to content

Instantly share code, notes, and snippets.

View IvantheTricourne's full-sized avatar
🦊
it's just data

Carl Factora IvantheTricourne

🦊
it's just data
View GitHub Profile
@IvantheTricourne
IvantheTricourne / Circle.agda
Created May 22, 2016 22:54
A (beginner) Homotopy Type Theory proof: two definitions of Circles are "homotopy equivalent"
{-# OPTIONS --without-K #-}
module Circle where
open import HoTT
open import Level using (_⊔_)
open import Data.Product using (Σ; _,_)
open import Function
-- Proof:
@IvantheTricourne
IvantheTricourne / Circle.agda
Created May 22, 2016 22:54
A (beginner) Homotopy Type Theory proof: Two definitions of Circles are "homotopy equivalent"
{-# OPTIONS --without-K #-}
module Circle where
open import HoTT
open import Level using (_⊔_)
open import Data.Product using (Σ; _,_)
open import Function
-- Proof:
module AST where
data AST = Val String
| Fun [AST]
deriving (Show)
takeWord :: String -> String -> (AST,String)
takeWord "" acc = (Val acc,"")
takeWord (' ':cs) acc = (Val acc,cs)
takeWord (c:cs) acc = takeWord cs (acc++[c])
module Parser where
import Data.Char
data Token = OpenPar
| ClosPar
| Fun String
| Value String
| Error
deriving (Show)
@IvantheTricourne
IvantheTricourne / DFS.py
Last active December 26, 2016 14:15
Recurse Interview (DFS problem)
from collections import deque
class Node:
def __init__(self,value,children):
self.value = value
self.children = children
def __str__(self):
return str(self.value)
@IvantheTricourne
IvantheTricourne / getSlippiCombos.js
Created January 13, 2020 18:33 — forked from NikhilNarayana/getSlippiCombos.js
Get Combos from Slippi files -- READ THE FIRST COMMENT BELOW
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const slp = require('slp-parser-js');
const SlippiGame = slp.default; // npm install slp-parser-js
const basePath = path.join(__dirname, 'slp/'); // this var is "<directory your script is in>/slp"
const outputFilename = "./combos.json";
@IvantheTricourne
IvantheTricourne / getGamesOnDate.js
Last active May 30, 2020 00:34
See first comment for usage/installation instructions.
// slippi deps
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const slp = require('slp-parser-js');
const SlippiGame = slp.default; // npm install slp-parser-js
// cli deps
const yargs = require('yargs'); // npm install yargs
/////////////////////////////////////////////////////////////////