Skip to content

Instantly share code, notes, and snippets.

@emhoracek
emhoracek / TicTacToe.elm
Last active August 29, 2015 14:04
Tic-Tac-Toe
import Array as A
import Window
import Graphics.Input as I
main = lift2 scene Window.dimensions gameState
--------------------------------------------------------
-- INPUT
@emhoracek
emhoracek / Adventure.hs
Last active August 29, 2015 14:04
Text exploration game
{-# LANGUAGE OverloadedStrings #-}
-- Oh boy did I make a mess of this. Tried to add a way to import an external file of places
-- using JSON (thanks to Zach from Hacker School!!!) but the nested objects make it kind
-- of difficult. Right now the exits are just a string but I would like it to be a nested
-- JSON object. But I really don't understand how that works, so it's a string of JSON,
-- which is super ugly. But it compiles!!
module Main where
@emhoracek
emhoracek / main.elm
Last active August 29, 2015 14:05
makerspace site
import Window
import String (concat, contains, toLower, any)
import Graphics.Input (Input, input, dropDown, customButton)
import Graphics.Input.Field as Field
import List (filter, map, take, intersperse, any)
main = lift4 scene Window.dimensions yrIdeas.signal yrEmail.signal click.signal
-- MODEL
# Doesn't work
sub label {
my ( $class, $u ) = @_;
return $_[0]->ml( 'setting.display.journaliconstyle.label.comm')
if $u && $u->is_community;
return $_[0]->ml( 'setting.display.journaliconstyle.label' );
}
# works
@emhoracek
emhoracek / gist:a35b4937f6ade4146eb3
Last active August 29, 2015 14:10
Now I can't figure out math
import Keyboard
import Window
import Text
import Random
import Debug
-- INPUTS
type Input = { space: Bool, delta: Time, randBalls: [Ball] }
@emhoracek
emhoracek / mariko.cnf
Created February 18, 2015 14:40
My first script
; ** FKiSS stuff **
;
;@EventHandler()
;
;@initialize()
;@ unmap("bubble1.cel")
;@ unmap("bubble2.cel")
;@ unmap("bubble3.cel")
;@ unmap("bubble4.cel")
;@ unmap("eye2.cel")
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* cel.c -- KISS CEL file format plug-in
* (copyright) 1997,1998 Nick Lamb ([email protected])
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.Either
safeHead :: [a] -> Maybe a
safeHead [] = Nothing
safeHead xs = Just $ head xs
maybeTHead :: MaybeT IO Char
maybeTHead = MaybeT $ do
str <- getUserInput

Keybase proof

I hereby claim:

  • I am emhoracek on github.
  • I am horrorcheck (https://keybase.io/horrorcheck) on keybase.
  • I have a public key whose fingerprint is 019C 0A06 358E 6FE1 B5C8 9C8D 3FB2 8C79 9086 99A0

To claim this, I am signing this object:

@emhoracek
emhoracek / viewer.html
Last active September 22, 2015 00:51
JS cel viewer!
<html>
<head><title>reading some cels and palettes!</title></head>
<body>
<div id="filepicker">
<p>Palette: <input type="file" id="pal-files" name="file" /> </p>
<p>Cel:<input type="file" id="cel-files" name="file" /> </p>
<span class="readBytesButtons">