Skip to content

Instantly share code, notes, and snippets.

View bigos's full-sized avatar

Jacek Podkanski bigos

  • North West England
View GitHub Profile
@bigos
bigos / trees.lisp
Created December 29, 2017 04:20
Experiment with tree traversal in Lisp
;;; tree traversal
(defparameter tr '((s
(num
(dig
(1))
(diga
(da
(2a))
(da
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified GI.Gtk as GI (init,
main)
import GI.Gtk (boxNew,
binGetChild,
boxPackStart,
checkButtonNew,
@bigos
bigos / simplified-haskell-install.org
Last active November 29, 2022 03:34
My way of installing Haskell on Windows so that I can build gi-gtk based stack projects

Simplified installation

already I have

choco msys2 emacs

Install GHC

open cmd as administrator

Press Windows button, in ‘Type to search’ type cmd, right-click on Command Promp Desktop app and select Run as administrator.

lines to paste in cmd

@bigos
bigos / new-haskell-gi-example.org
Last active December 3, 2017 05:08
Description of Haskell installation and configuration on Windows 10

New attempt

instaled new test VM

updated the language and found that Power shell responds to

choco version
Chocolatey v0.10.8

installed MSYS2

Used Admin cmd

Missing Instructions

@bigos
bigos / haskell-environment.org
Last active December 3, 2017 00:42
Environment used for experimenting with Haskell

Haskell installation experiment

download core Haskell platform

https://www.haskell.org/platform/

Install it to a destination folder without spaces

update mingw64 terminal

pacman -Syu, then kill the terminal when prompted restart it and resume update with pacman -Su

install required packages

pacman -S mingw64/mingw-w64-x86_64-pkg-config mingw64/mingw-w64-x86_64-clutter mingw64/mingw-w64-x86_64-gobject-introspection
@bigos
bigos / importer-sample.rb
Created March 3, 2017 16:40
Sample of my Ruby code written 2 years ago
require 'csv'
# helper code for importing csv orders
class ReceiptImporter
attr_reader :found_errors, :invalid_receipts, :skipped_receipts, :imported_receipts, :total_receipts
def initialize(filepath, mode)
@depot = Depot.find Depot.current
@mode = mode
@record_types = { 'FH' => :file_header,
'RH' => :receipt_header,
@bigos
bigos / excercise-1_9.lisp
Created December 18, 2016 23:55
Unfolded lisp code
(defun max-int (a)
(cond ((null a)
(error "empty list"))
((null (cdr a))
(car a))
(T
(max (car a)
(max-int (cdr a))))))
@bigos
bigos / gist:adf886bc8c8241e1c48d2455e53f3a7a
Created December 18, 2016 23:39
Emacs Lisp function for unfolding lisp code
;; you can use this function to unfold s-exps so that newline follows after one or more closing brackets
(defun unfold-lisp ()
"Unfold lisp code."
(interactive)
(search-forward ")")
(backward-char)
(search-forward " ")
(newline-and-indent))
(global-set-key (kbd "s-0") 'unfold-lisp)
@bigos
bigos / _reader-macros.md
Created November 26, 2016 23:49 — forked from chaitanyagupta/_reader-macros.md
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@bigos
bigos / colours.html
Last active April 16, 2016 00:12
colour suggestions for slime-presentations.el
<html>
<head>
<title>Colour selection</title>
<style>
.grey{color:#777;}
.red{color:red;}
.yellow{color: yellow;}
.orange-red{color: #ff4500;}
.tomato{color: #ff6347;}
.light-coral{color: #f08080;}