Skip to content

Instantly share code, notes, and snippets.

Karl-Oskar Rikås funrep

Block or report user

Report or block funrep

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@funrep
funrep / lisp.sml
Created Jun 3, 2014
Unfinished (but working) lisp interpreter in SML.
View lisp.sml
(* simple lisp interpreter *)
type sym = string
datatype exp = Sym of sym
| List of exp list
| Num of int
| Str of string
| Bool of bool
| Lam of (sym list) * ((sym * exp) list) * exp
@funrep
funrep / ECS.cs
Created Dec 14, 2015
Barebones Entity Component System in C#
View ECS.cs
using System.Collections.Generic;
using System.Linq;
namespace ProjectCC
{
class World
{
private List<Entity> Entities;
private List<System> Systems;
@funrep
funrep / bf3.hs
Created Sep 14, 2013
How to make AAA 3D games in Haskell
View bf3.hs
import Game.AAAGameDevEnv (GameEngine (..), GameData (..))
main = frostbite $ bf3
frostbite :: GameData -> GameEngine
frostbite game = Engine {
version = 2.3.2,
directX = yes,
realLifePhysics = enabled,
gameStuff = game
@funrep
funrep / Layer.java
Created Jun 20, 2017
Neural net - not working
View Layer.java
import java.util.ArrayList;
public class Layer {
private ArrayList<Neuron> nodes;
public Layer(int nodeCount, int inputCount) {
nodes = new ArrayList<>();
for (int i = 0; i < nodeCount; i++) {
nodes.add(new Neuron(inputCount));
}
View lab1.clj
(ns edaa40.lab1)
(use 'clojure.set)
;;
;; testing
;;
(defn test?
[msg v1 v2]
@funrep
funrep / gist:8301310
Last active Jan 2, 2016
Weird behaviour by the Parser params
View gist:8301310
params :: Parser Params
params = do
ps <- takeWhile (notInClass ":\r") `sepBy` space
View hoc.y
%{
#define YYSTYPE double /* data type of yacc stack */
%}
%token NUMBER
%left '+' '-' /* left associative, same precedence */
%left '*' '/' /* left assoc., higher precedence */
%left UNARYMINUS
%%
list: /* nothing */
| list '\n'
View ircparser.hs
{-# LANGUAGE OverloadedStrings #-}
module Tob.Parser where
-- (maybe ':') (maybe adress) (command) (params) (maybe ':') (maybe stuff)
import Prelude hiding (takeWhile)
import Control.Applicative ((<|>))
import Data.Text (Text)
import Data.Char (isUpper)
import Data.Attoparsec.Text
View weird.md
pipe inp s = inp >>= \x -> sh $ T.concat ["echo ", "\"", x, "\"", " | ", s]
DotHellRC.hs:37:33:
    Couldn't match expected type `Data.Text.Lazy.Internal.Text'
                with actual type `T.Text'
    In the return type of a call of `T.concat'
    In the second argument of `($)', namely
You can’t perform that action at this time.