Skip to content

Instantly share code, notes, and snippets.

@Tayacan
Tayacan / Hypergraph.hs
Created June 25, 2018 07:53
For a reddit answer
{-# LANGUAGE GADTs, KindSignatures, DataKinds #-}
data Nat = Z | S Nat
data SNat n where
SZ :: SNat Z
SS :: SNat n -> SNat (S n)
data Vect (n :: Nat) a where
VNil :: Vect Z a
@Tayacan
Tayacan / D1.hs
Last active December 2, 2017 12:31
Advent of Code 2017, Haskell Golf Edition
module D1(a,b)where
r n l=sum$zipWith(\x y->if x==y then read[x]else 0)l$drop n$cycle l
a=r 1
b l=r(div(length l)2)l
module RegexParser (regex) where
import Text.ParserCombinators.ReadP hiding (munch, munch1, option)
import Control.Applicative ((<|>), (<*))
-- The parsers that we create just parse strings
type RegexP = ReadP String
-- | Parse a regex (the first string) and match against the second string
regex :: String -> String -> Maybe String
@Tayacan
Tayacan / com.py
Last active August 29, 2015 14:07
n = int(raw_input())
nodes = {}
class Node:
def __init__(self, name, drunk, parent = None, nodes = nodes):
self.name = name
self.drunk = drunk
self.superior = None
try:

Keybase proof

I hereby claim:

  • I am Tayacan on github.
  • I am tayacan (https://keybase.io/tayacan) on keybase.
  • I have a public key whose fingerprint is FFB9 826D 5736 7029 5306 AB94 DC32 4286 EF1D 7AE0

To claim this, I am signing this object:

@Tayacan
Tayacan / booklist.txt
Last active December 19, 2015 06:09
Books I should read.
Neil Gaiman
* The Ocean at the End of the Lane
* American Gods
* The Graveyard Book
* Sandman
* Fragile Things
Brandon Sanderson
* Alcatraz
@Tayacan
Tayacan / cartoon.py
Created April 4, 2013 14:52
Cartoonify an image!
#!/usr/bin/env python
from PIL import Image
import random
import math
import sys
#im = Image.open("/home/maya/Pictures/419471_4715907697709_351909531_n.jpg")
if len(sys.argv) < 4:
print "Usage: cluster.py infile outfile k"
@Tayacan
Tayacan / cd.sql
Last active December 14, 2015 12:58
CD database for my database course.
drop table cd;
create table cd(cdid integer, title varchar(30), year integer, genre varchar(20));
drop table track;
create table track(cdid integer,position integer,title varchar(30), length integer);
drop table artist;
@Tayacan
Tayacan / sqlp.sh
Created February 5, 2013 12:39
Easy login with hidden password to the database for DBDM/DBWP. Replace XXX with your number.
#/bin/sh
read -s -p "Password: " pswd
sqlplus -L DB_XXX/$pswd@//dbw.diku.dk/dbwc $@
using UnityEngine;
using System.Collections;
// Keep track of where we are in the scene.
// When z-coord of the player goes above a
// certain level, reset coords of everything.
public class Infinity : MonoBehaviour
{
public GameObject player;
public float maxZ;