Skip to content

Instantly share code, notes, and snippets.

View amirouche's full-sized avatar

Amir Amazigh BOUBEKKI amirouche

View GitHub Profile
@amirouche
amirouche / .emacs
Created May 29, 2015 17:26
my humble .emacs
(require 'package)
;; todo
;; - bind marks commands
(add-to-list
'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(add-to-list
@amirouche
amirouche / flexbox-demo.py
Last active August 29, 2015 14:22
kivy + colosseum demo of a flexbox layout
"""DON't forget to pip install colosseum"""
from kivy.app import App
from kivy.uix.button import Button
from colosseum import CSSNode
from colosseum import COLUMN
from colosseum import ROW
from kivy.uix.layout import Layout
@amirouche
amirouche / alien.sly.scm
Created June 5, 2015 11:56
Alien pong (WIP)
;;; Sly
;;; Copyright (C) 2013-2015 David Thompson <dthompson2@worcester.edu>
;;; and Amirouche Boubekki <amirouche@hypermove.net>
;;;
;;; 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.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; Sly
;;; Copyright (C) 2013-2015 David Thompson <dthompson2@worcester.edu>
;;; and Amirouche Boubekki <amirouche@hypermove.net>
;;;
;;; 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.
;;;
;;; This program is distributed in the hope that it will be useful,
@amirouche
amirouche / no5.py
Last active July 20, 2016 19:08
no5: Declarative API for Python 3. It support inheritance but not references/FK (CC0 licensed)
"""Generic declarative API. Does not support references/fk"""
# This file is licensed under CC0
# cf. https://docs.python.org/3/reference/datamodel.html#customizing-class-creation
from collections import OrderedDict
class Property(object):
"""Base class data-descriptor for element properties.
Subclass it to implement new types. Most likely you will
(use-modules (ice-9 match))
(use-modules (sxml simple))
(use-modules (logic guile-log))
(use-modules (logic guile-log umatch))
(use-modules (logic guile-log parser))
;; text
(use-modules (ice-9 match))
(use-modules (sxml simple))
(use-modules (logic guile-log))
(use-modules (logic guile-log umatch))
(use-modules (logic guile-log parser))
;; text
@amirouche
amirouche / thinkero.md
Last active June 14, 2022 21:00
thinkero brainstorming

Thinkero

Licensed with cc-by-sa. You must mail amirouche@hyper.dev if you use this work. Thank you!

But I because I'm poor, I have only my dreams
I spread my dreams under your feet,
Tread softly because you tread on my dreams
@amirouche
amirouche / guile.md
Last active August 29, 2015 14:26
Guile brainstorming

Why GNU Guile

Guile a powerful Scheme language and standard library

  • exact math
  • tail recursion
  • hygienic macros (can be broken explicitly)
  • object orientation as you need it (GOOPS)

... and if you want something else reuse strict ECMAscript (Javascript), Emacs Lisp or basic Lua or just add a new language

@amirouche
amirouche / simple-subprocess-pipeline.py
Created August 15, 2015 01:43
Create a pipeline of (bash) commands using subprocess and trollius (or asyncio)
import trollius
from trollius import From
# from trollius import Return
from trollius import gather
from trollius import create_subprocess_shell
# create dummy bash programs
def bash_program(name, sleep, code):
with open(name, 'w') as f: