Skip to content

Instantly share code, notes, and snippets.

View marijnh's full-sized avatar

Marijn Haverbeke marijnh

View GitHub Profile
@marijnh
marijnh / gist:3633900
Created September 5, 2012 09:16
Failure to npm install js-yaml
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'js-yaml' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /home/marijn/src/js/heckle/package.json
5 verbose read json /home/marijn/src/js/heckle/node_modules/rimraf/package.json
6 verbose read json /home/marijn/src/js/heckle/node_modules/dateformat/package.json
7 verbose read json /home/marijn/src/js/heckle/node_modules/marked/package.json
8 verbose from cache /home/marijn/src/js/heckle/package.json
9 verbose readDependencies using package.json deps
function indentOnBrace(cm) {
var cursor = cm.getCursor(), line = cm.getLine(cursor.line);
var indent = cursor.ch == 0 || /^\s*$/.test(line.slice(0, cursor.ch));
cm.replaceSelection("}", "end");
if (indent) cm.indentLine(cursor.line);
}
instance.setOption("electricChars", false);
instance.setOption("extraKeys", {"'}'": indentOnBrace});
@marijnh
marijnh / gist:4013062
Created November 4, 2012 18:54
Nginx patch to make WebDAV module respect if-unmodified-since
Index: src/http/modules/ngx_http_dav_module.c
===================================================================
--- src/http/modules/ngx_http_dav_module.c (revision 4898)
+++ src/http/modules/ngx_http_dav_module.c (working copy)
@@ -55,6 +55,9 @@
static ngx_int_t ngx_http_dav_copy_tree_file(ngx_tree_ctx_t *ctx,
ngx_str_t *path);
+static ngx_int_t ngx_http_dav_check_unmodified(ngx_http_request_t *r,
+ ngx_file_info_t *fi);
@marijnh
marijnh / gist:4202141
Created December 4, 2012 09:23
CodeMirror almost full height
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<link href="lib/codemirror.css" rel="stylesheet">
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
.wrap {
position: relative;
height: 100%;
@marijnh
marijnh / gist:6698289
Created September 25, 2013 11:22
Eloquent JS, chapter 4 plot draft
== The weresquirrel ==
Every now and then, usually between eight and ten in the evening,
Jaques finds himself transforming into a small furry rodent with a
bushy tail.
One the one hand, Jaques is quite glad that he doesn't have classical
lycantropy. Turning into a squirrel tends to cause less problems than
turning into a wolf. Instead of having to worry about accidentally
eating the neighbor (that would be extremely awkward), he worries
@marijnh
marijnh / gist:9683027
Created March 21, 2014 10:02
CodeMirror merge view resize to fit content
function mergeViewHeight(mergeView) {
function editorHeight(editor) {
if (!editor) return 0;
return editor.getScrollInfo().height;
}
return Math.max(editorHeight(mergeView.leftOriginal()),
editorHeight(mergeView.editor()),
editorHeight(mergeView.rightOriginal()));
}
@marijnh
marijnh / keybase.md
Created March 25, 2014 15:11
keybase identity proof

Keybase proof

I hereby claim:

  • I am marijnh on github.
  • I am marijn (https://keybase.io/marijn) on keybase.
  • I have a public key whose fingerprint is 5FCE D776 F73F 8AAA 26C1 6B92 2101 D645 F88A BE15

To claim this, I am signing this object:

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2014.5.20) 10 JUL 2014 12:08
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**nssample.tex
(./nssample.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 2 languages loaded.
(./nostarch.cls
Document Class: nostarch 2008/06/06 v1.3 Typesetting books for No Starch Press
@marijnh
marijnh / keybase.md
Created September 18, 2014 22:06
keybase.md

Keybase proof

I hereby claim:

  • I am marijnh on github.
  • I am marijn (https://keybase.io/marijn) on keybase.
  • I have a public key whose fingerprint is ACB6 36D2 3FBF 963B C944 7A2D 703F 1BED 6D33 AE1E

To claim this, I am signing this object:

@marijnh
marijnh / test.html
Created January 30, 2015 22:27
codemirror test
<!doctype html>
<script src="lib/codemirror.js"></script>
<link rel=stylesheet href="lib/codemirror.css">
<style>
.code-wrap {
width: 50%;
border: 2px solid red;
}</style>