This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftype rawdata () '(array (unsigned-byte 8) 1)) | |
(defclass memstream (fundamental-binary-input-stream fundamental-binary-output-stream) | |
((data :initarg :data | |
:type rawdata | |
:initform (make-array 0 :adjustable t | |
:fill-pointer 0 | |
:element-type '(unsigned-byte 8)) | |
:accessor memstream-data) | |
(size :initarg :size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defgeneric image-size (input) | |
(:method ((input pathname)) | |
(with-open-file (input input :element-type 'unsigned-byte) | |
(image-size input))) | |
(:method ((input string)) | |
(with-open-file (input input :element-type 'unsigned-byte) | |
(image-size input))) | |
(:method ((input stream)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = [ '5' => 1, '6' => 2, '7' => 3 ]; | |
echo json_encode($x); // outputs {"5":1,"6":2,"7":3} | |
$y = array_merge($x, [ '8' => 4 ]); | |
echo json_encode($y); // outputs [1,2,3,4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun unfill-paragraph () | |
"Takes a multi-line paragraph and makes it into a single line of text." | |
(interactive) | |
(let ((fill-column (point-max))) | |
(fill-paragraph nil))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.counters { | |
counter-reset: xxx; | |
} | |
.counters > p { | |
counter-increment: xxx; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Kendo Diagramming</title> | |
<link rel="stylesheet/less" type="text/css" href="../../styles/web/kendo.common.less"/> | |
<link rel="stylesheet/less" type="text/css" href="../../styles/web/kendo.default.less"/> | |
<link rel="stylesheet/less" type="text/css" href="../../styles/dataviz/kendo.dataviz.less"/> | |
<link rel="stylesheet/less" type="text/css" href="../../styles/dataviz/kendo.dataviz.default.less"/> | |
<script type="text/javascript" src="../../demos/mvc/content/shared/js/less.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- js -*- | |
xkb_keymap "mishoo" { | |
xkb_keycodes { include "evdev+aliases(qwertz)" }; | |
xkb_types { include "complete" }; | |
xkb_compat { include "complete" }; | |
xkb_symbols { | |
include "pc+us+inet(evdev)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// Safari parser bug | |
//// derived from: https://github.com/mishoo/UglifyJS2/issues/313 | |
// fails with SyntaxError: Expected token ')' | |
( function(){ return this || eval('this'); }().x = "y" ); | |
// fails with SyntaxError: Unexpected token '=' | |
1, function(){ return this || eval('this'); }().x = "y"; | |
//// weird that we get different error messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define throw (lambda (tag val) | |
(error "Uncaught throw " tag))) | |
(define (catch* needle thunk) | |
(call/cc (lambda (k) | |
(define prev throw) | |
(fluid-let ((throw (lambda (try val) | |
(if (eq try needle) | |
(k val) | |
(prev try val))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; stupid-indent-mode.el --- Plain stupid indentation minor mode | |
;; Copyright (C) 2013 Mihai Bazon | |
;; Author: Mihai Bazon <[email protected]> | |
;; Keywords: | |
;; 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 |
NewerOlder