Skip to content

Instantly share code, notes, and snippets.

View Ferada's full-sized avatar
☀️
~\[T]/~

Olof-Joachim Frahm (欧雅福) Ferada

☀️
~\[T]/~
View GitHub Profile
@Ferada
Ferada / rfc-feature.lisp
Created October 31, 2012 22:42
cl reader feature expressions with numeric prefix
;; scratch buffer created 2012-10-31 at 20:48:06
(in-package #:cl)
;;; the goal is to enable #+ and #- to ignore multiple expressions by
;;; supplying an additional numeric prefix
;;; zero is kind of pointless, but would be accepted, possibly with a
;;; warning, one is the default
@Ferada
Ferada / scratch-eqv-next-after.lisp
Created November 15, 2012 16:47
eqv1/2 and next-after
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(in-package #:cl-user)
;;; <http://en.wikipedia.org/wiki/Logical_biconditional>
(defmacro eqv1 (&rest forms)
(or (null forms)
@Ferada
Ferada / html5-parser-cxml.lisp
Created May 9, 2014 14:23
html5-parser-cxml.lisp
;;; -*- mode: lisp; syntax: common-lisp; coding: utf-8-unix; package: html5-parser; -*-
(in-package #:html5-parser)
;;; Change the DOM of the HTML5-PARSER library to work with the CXML DOM
;;; protocol. It's not particularly efficient, but better then making a
;;; copy every time.
;;; Class definitions are copied and modified. Using the MOP would be
;;; possible as well. Also not every single function is implemented, just
@Ferada
Ferada / gist:374b0f3f9a777ef6f27d
Created December 3, 2014 14:56
DigitalOcean error in tugboat.
0 ~ % tugboat ssh -e my-host
Droplet fuzzy name provided. Finding droplet ID...757: unexpected token at '<!DOCTYPE html>
<html>
<head>
<title>DigitalOcean - Seems we've encountered a problem!</title>
<style type="text/css">
body {
background-color: #27a1e3;
margin: 0px;
padding: 0px;
@Ferada
Ferada / gist:757c386eff126e73dfe6
Last active August 29, 2015 14:10
Another one.
0 % DEBUG=2 tugboat ssh -e my-host
Droplet fuzzy name provided. Finding droplet ID...I, [2014-12-03T15:13:37.827339 #2424] INFO -- : Started GET request to: https://api.digitalocean.com/droplets?client_id=UH7mlwnlc2YmFli8HtTmy&api_key=b98c40df867aadd134ad6c4e0311bd57
D, [2014-12-03T15:13:37.827523 #2424] DEBUG -- : Request Headers:
----------------
User-Agent : Faraday v0.8.9
Request Body:
-------------
From 991fac513dbd9b86628f99741a66d791552b1f02 Mon Sep 17 00:00:00 2001
From: Olof-Joachim Frahm <[email protected]>
Date: Sun, 15 Feb 2015 15:56:21 +0000
Subject: [PATCH] Fix DTD embedding.
---
xml/xml-parse.lisp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/xml/xml-parse.lisp b/xml/xml-parse.lisp
% May 15 - May 16 - May 19
% June 17 - June 18
% July 14 - July 16
% August 14 - August 15 - August 17
% July 14 - July 16
% August 14 - August 15 - August 17
% July 16
@Ferada
Ferada / keybase.md
Last active December 23, 2016 22:57
keybase.md

Keybase proof

I hereby claim:

  • I am Ferada on github.
  • I am ferada (https://keybase.io/ferada) on keybase.
  • I have a public key whose fingerprint is 8298 70B4 F2ED 83EE D9CA 701F AB09 10EE 7C36 342F

To claim this, I am signing this object:

@Ferada
Ferada / izip_checked.py
Last active August 29, 2015 14:21
Checked Python izip variant.
class izip_checked(object):
def __init__(self, *args):
self._iterators = map(iter, args)
def __iter__(self):
if self._iterators:
return self
return iter([])
def next(self):
// ReadSeekerCloser combines a ReadSeeker with a Closer. Brilliant, isn't it.
type ReadSeekerCloser interface {
io.ReadSeeker
io.Closer
}