Skip to content

Instantly share code, notes, and snippets.

(function(window) {
var fromMessage = function(message) {
return {client: message[0],
command: message[1],
data: message[2]};
}
var toMessage = function(prev, command, data) {
return [prev.client,
@ibdknox
ibdknox / bootstrap.js
Last active December 14, 2015 16:08
hopefully international keyboards with altgr work now
This file has been truncated, but you can view the full file.
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.provide = function(a) {
if(!COMPILED) {
if(goog.isProvided_(a)) {
throw Error('Namespace "' + a + '" already declared.');
}
delete goog.implicitNamespaces_[a];
@ibdknox
ibdknox / bootstrap.js
Created March 7, 2013 17:04
AltGr fix
This file has been truncated, but you can view the full file.
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.provide = function(a) {
if(!COMPILED) {
if(goog.isProvided_(a)) {
throw Error('Namespace "' + a + '" already declared.');
}
delete goog.implicitNamespaces_[a];
@ibdknox
ibdknox / bootstrap.js
Created March 4, 2013 00:58
save debug
This file has been truncated, but you can view the full file.
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.provide = function(a) {
if(!COMPILED) {
if(goog.isProvided_(a)) {
throw Error('Namespace "' + a + '" already declared.');
}
delete goog.implicitNamespaces_[a];
@ibdknox
ibdknox / test.html
Created February 21, 2013 23:22
3.1 very slow refresh
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Active Line Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<script src="../mode/css/css.js"></script>
<script src="../addon/selection/active-line.js"></script>
<link rel="stylesheet" href="../doc/docs.css">
@ibdknox
ibdknox / widgetcutoff.html
Created January 31, 2013 22:05
example of codemirror widgets getting cut off.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Inline Widget Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<script src="../mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="../doc/docs.css">
@ibdknox
ibdknox / refresh.html
Created January 16, 2013 22:17
refresh rates demo
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Active Line Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<script src="../mode/xml/xml.js"></script>
<link rel="stylesheet" href="../doc/docs.css">
@ibdknox
ibdknox / clojure-mode.js
Created January 8, 2013 03:18
better clj mode
/**
* Author: Hans Engel
* Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun)
*/
CodeMirror.defineMode("clojure", function () {
var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHAR = "char",
ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword";
var INDENT_WORD_SKIP = 2;
function makeKeywords(str) {
@ibdknox
ibdknox / core.clj
Created December 27, 2012 20:49
example of how to handle relation maps.
(defn rel-map
[ent sub-ent type opts]
(assoc-in ent [:rel (:name sub-ent)]
(delay
(create-relation ent sub-ent type opts))))
(defmacro has-one
"Add a has-one relationship for the given entity. It is assumed that the foreign key
is on the sub-entity with the format table_id: user.id = address.user_id
Opts can include a key for :fk to explicitly set the foreign key.
@ibdknox
ibdknox / activeline.html
Created December 4, 2012 19:17
CodeMirror V3 refresh doesn't calculate max line
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Active Line Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<script src="../mode/xml/xml.js"></script>
<link rel="stylesheet" href="../doc/docs.css">