Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
PuercoPop / gist:be774f6e3d7f33c0ac64
Created July 29, 2015 22:42
xcb tripping on unix sockets filename as hostname
/*
Testing if "private/tmp/com.apple.launchd.EauNyeZmg1/org.macosforge.xquartz" is a valid display name
For more information see:
- http://www.x.org/releases/current/doc/libX11/libX11/libX11.html#XOpenDisplay
- http://cgit.freedesktop.org/~chr/libxcb/tree/src/xcb_util.c
*/
#include <stdio.h>
#include <xcb/xcbext.h>
(defpackage :slynk-websocket-proxy
(:use :cl :hunchensocket))
(in-package :slynk-websocket-proxy)
(defclass ws-proxy (websocket-resource)
((slynk-channel :initarg :channel
:initform (make-instance 'slynk::channel)
:reader channel
:documentation "The slynk part")
(%thread :accessor %thread)))
@PuercoPop
PuercoPop / sly-repl-ansi-color.el
Last active August 29, 2015 14:19
add ```(push 'sly-repl-ansi-color sly-contribs)``` to your init.el
;; Ported from is Max Mikhanosha's code.
(require 'ansi-color)
(define-sly-contrib sly-repl-ansi-color
"Turn on ANSI colors in the mREPL output"
(:authors "Max Mikhanosha")
(:license "GPL")
(:sly-dependencies sly-mrepl)
(:on-load (progn
(sly-repl-ansi-on)
@PuercoPop
PuercoPop / gulpfile.js
Last active August 29, 2015 14:17
En el directorio del projecto, escribe 'npm install gulp less gulp-less gulp-watch' Luego copia el archivo Gulpfile y desde powershell escribe gulp en powershell. Ahora cuando salves cualquier .less en la carpeta source/static/styles se generaran los .css.
var gulp = require('gulp');
var less = require('gulp-less');
var watch = require('gulp-watch');
gulp.task('minify', function () {
return gulp.src('source/static/styles/*.less')
.pipe(less({})).on('error', function () {})
.pipe(gulp.dest('source/static/styles'));
});
(require ometa)
(define-ometa-namespace parser)
(define-ometa py-parser
(literal (seq (list (atom lit) (bind value (atom anything)))
(-> value))))
(omatch
py-parser

Preambulo

Show me your code and conceal your data structures, and I shall continue to be
mystified. Show me your data structures, and I won't need your code.
(require 'creole)
(require 'cl)
(defun creole-extract-heading-level (heading)
(string-to-number (save-match-data
(string-match
(rx "heading" (group (+ digit)))
heading)
(match-string 1 heading))))
(defpackage #:ngit
(:use :cl :chipz :babel))
(in-package #:ngit)
(defun from-first-space (string)
(subseq string (1+ (position #\Space string))))
(defclass git-repo ()
((path :initarg :path :reader path)))
(with-current-buffer "grovel.lisp"
(while (not (eq (point) (point-max)))
(when (search-forward "/**" (line-end-position) t)
(backward-char 3)
(delete-region (point) (line-end-position)))
(forward-line)))
(with-current-buffer "grovel.lisp"
(while (not (eq (point) (point-max)))
(when (looking-at "#")