Skip to content

Instantly share code, notes, and snippets.

(defpackage #:dixit/conf
(:use :cl)
(:export
#:*db-name*
#:*db-host*
#:*db-port*
#:*db-timeout*))
(in-package :dixit/conf)
(defvar *db-name*)
@PuercoPop
PuercoPop / Python 'Perú' Noviembre 2014.ipynb
Created October 16, 2014 04:59
iPython Notebook para el sgte Python Meetup
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(defpackage :famiclom-tests*
(:use :cl :famiclom :hu.dwim.stefil))
(in-package :famiclom-tests*)
(defsuite (input-suite :in root-suite)
(run-child-tests))
(in-suite input-suite)
;; Buttoms should not be set on 0
(defun sly-copy-next-sexp (results key-name)
(kill-ring-save (point) (save-excursion (forward-sexp) (point)))
(cl-acons key-name (substring-no-properties (current-kill 0)) results))
(defun sly-extract-slyfuns ()
"Return a list of alists of the form ((slyfun-name ...) (slyfun-doc-string ...))."
(with-current-buffer "slynk.lisp"
(goto-char (point-min))
(cl-loop
with results = nil
@PuercoPop
PuercoPop / gist:97c9e90dd1a0899cc202
Last active August 29, 2015 14:07
Instructions: 1. Stare at the background and you will see a green dot rotating. 2. Follow the green dot and it will disappear. 3. Focus on the '+' in the middle and after a while the pink dots will disappear 4. Stare at the top circle and more weird stuff happens. Adapted from: http://visualfunhouse.com/animations/disappearing-dots-illusion.html
(ql:quickload :lispbuilder-sdl)
(in-package :lispbuilder-sdl)
(defparameter *radius* 50 "The radius of the button in Pixels.")
(defparameter *active-color* (sdl:color :r 178 :g 178 :b 178))
(defparameter *inactive-color* *magenta*)
(defvar *active* 0 "The index of the 'active' circle.")
(defparameter *positions* (list (point :x 300 :y 100) ; Top
@PuercoPop
PuercoPop / generate.js
Created September 10, 2014 07:41
Código para mi presentación en LimaJS, diapositivas en https://slides.com/puercopop/escodgen/
#!/usr/bin/js
var fs = require('fs');
var escodegen = require('escodegen');
var inputFile = process.argv[2] ? process.argv[2] : "/home/puercopop/tmp.js";
var outputFile = process.argv[3] ? process.argv[3] : "/home/puercopop/a.js";
var code;
fs.readFile(inputFile, 'utf8', function (err, data) {
LISPKIT> (load-ui-from-file (asdf:system-relative-pathname :lispkit "main.ui"))
#<GTK-BUILDER {10070732D3}>
LISPKIT> (gtk:gtk-builder-get-object #<GTK-BUILDER {10070732D3}> "webviewcontainer" )
NIL
LISPKIT> (gtk:gtk-builder-get-object #<GTK-BUILDER {10070732D3}> "mainwindow" )
NIL
LISPKIT> (asdf:system-relative-pathname :lispkit "main.ui")
#P"/home/puercopop/quicklisp/local-projects/lispkit/main.ui"
LISPKIT> (gtk:gtk-builder-get-object #<GTK-BUILDER {10070732D3}> "scrolledwindow" )
NIL
@PuercoPop
PuercoPop / not-mac.xkb
Last active July 2, 2016 15:51
My Keyboard layout for Linux, mimicing the mac layout
xkb_keymap {
xkb_keycodes "evdev+aliases(qwerty)" {
minimum = 8;
maximum = 255;
<ESC> = 9;
<AE01> = 10;
<AE02> = 11;
<AE03> = 12;
<AE04> = 13;
<AE05> = 14;
#!/usr/bin/cl -Q -sp coleslaw --entry entry
;;;;
;; This script assumes it is executed from the repository's top level directory
;; to determine correctly the blog-dir variable.
;;;;
;; (coleslaw:preview #P"/home/puercopop/Projects/RunaRimac/hello-world.md")
(defun entry (argv)
(declare (ignorable argv))
(let
@PuercoPop
PuercoPop / sicp.ss
Created July 28, 2014 11:25
File with amb bug for "set!: cannot mutate module-required identifier" on soegaard's sicp.ss that neil's sicp depends on. The bug was caused due to set! being disabled for variables imported by a module: http://docs.racket-lang.org/guide/module-set.html
(module sicp mzscheme
;;; PLT Picture Language
(provide (all-from "painters.ss"))
(require "painters.ss")
;;; STREAMS
(provide cons-stream)