Skip to content

Instantly share code, notes, and snippets.


Gregor ggb

  • Kiel
View GitHub Profile
ggb /
Created Oct 14, 2019
Script to create a game graph for 3x3 Nim
import networkx as nx
import matplotlib.pyplot as plt
import itertools
l = list(range(4))
lists = [l, l, l]
result = []
for element in itertools.product(*lists):
l = list(element)
View Philosophie.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
:- use_module(library(semweb/rdf_db)).
:- use_module(library(semweb/rdf_http_plugin)).
load_band(A, S) :-
rdf_load(A, [format(xml)]),
findall(B, (rdf(A,'',B)), L1),
findall(C, (rdf(C,'',A)), L2),
append(L1, L2, S).
load_bands(_, _, _, 500) :-
View frequency.erl
%% Based on code from
%% Erlang Programming
%% Francecso Cesarini and Simon Thompson
%% O'Reilly, 2008
%% (c) Francesco Cesarini and Simon Thompson
ggb / DecodeUnionType.elm
Created Mar 29, 2017
How to decode union types in Elm
View DecodeUnionType.elm
import Html exposing (text)
import Json.Decode exposing (..)
type Status
= Done
| Open
| Failed
ggb / sicp44.dl
Created Mar 21, 2017
Database and solutions from "Structure and Interpretation of Computer Programs", Chapter 4.4
View sicp44.dl
#lang datalog
town(ben, slumerville).
street(ben, ridge_road).
str_number(ben, 10).
department(ben, computer).
position(ben, guru).
salary(ben, 60000).
town(alyssa, cambridge).
ggb / assignment2.erl
Created Mar 1, 2017
Functional Programming in Erlang - Second Assignment
View assignment2.erl
% test the code by calling
% assignment2:index("gettysburg-address.txt").
% assignment2:index("dickens-christmas.txt").
clean_line([], C) ->
ggb / assignment1.erl
Created Feb 27, 2017
Functional Programming in Erlang - First Assignment
View assignment1.erl
-export([bits/1, area/1, perimeter/1, enclose/1, bits_rec/1]).
% Shapes
% How the shapes are defined:
% circle: {circle, {x, y}, r}
% rectangle: {rectangle, {x1, y1},{x2, y2}}
% triangle: {triangle, {x1, y1}, A, B, C}
area({circle, {_X, _Y}, R}) ->
ggb / Table.html
Last active Feb 5, 2017
Endless scrolling table...
View Table.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>lazy table</title>
<link rel="stylesheet" href="style.css">
<script src=""></script>
<table id="lazyTable"></table>
ggb / sw_query.rkt
Created Oct 9, 2016
How to query the SWAPI (Star Wars API) with racket
View sw_query.rkt
#lang racket
(require json)
(require net/url)
(define (get url)
(call/input-url (string->url url)
(curry get-pure-port #:redirections 4)
You can’t perform that action at this time.