Skip to content

Instantly share code, notes, and snippets.

😡
Fuck ICE (& GitHub for supporting them)

Theresa O'Connor hober

😡
Fuck ICE (& GitHub for supporting them)
Block or report user

Report or block hober

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Is this a JSDOM bug, an HTML5 serializer bug, or what?
/* Using aredridel/html5 and tmpvar/jsdom */
var sys = require('sys');
var HTML5 = require('html5');
var p = new HTML5.Parser("<p>hello, world");
p.parse();
var doc = p.document;
View Ugly node REPL when run as an inferior process in Emacs
Type '.help' for options.
^[[0Gnode> ^[[0K^[[0G^[[6C
^[[0G^[[0Gnode> ^[[0K^[[0G^[[6Ca
a
^[[0GReferenceError: a is not defined
at [object Context]:1:1
at Interface.<anonymous> (repl:77:19)
at Interface.emit (events:26:26)
at Interface._ttyWrite (readline:221:12)
View jsdom-attr-problem.js
var sys = require('sys');
var browser = require('jsdom/browser')
var domToHtml = require('jsdom/browser/domtohtml').domToHtml;
var DOM = browser.browserAugmentation(require('jsdom/level2/core').dom.level2.core)
var doc = new DOM.Document('html');
doc.appendChild(doc.createElement('html'));
var headEl = doc.createElement('head');
View node-discount garbage
With a markdown document hello.md like so:
# hello, world
Repeated calls to markdown.parse produce different kinds of garbage at the end:
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
'<h1>hello, world</h1>^?>\n '
node> markdown.parse(fs.readFileSync('hello.md', 'utf8'));
View fun with Aria's HTML parser and jsdom
Given this source document:
<!DOCTYPE html>
<title>Edward O’Connor</title>
<link rel=openid.server href=http://www.myopenid.com/server>
<link rel=openid.delegate href=http://hober.myopenid.com>
<h1>Edward O’Connor</h1>
<p>Hi, I’m Ted.
The code generates (a longer version of) this document:
View mtucker-mark-comment.el
(defun mtucker-mark-comment (&optional pos)
(interactive "d")
(let ((initial pos)
(syntax (syntax-ppss pos)))
(if (nth 4 syntax)
(progn
(push-mark (nth 8 syntax) nil t)
(while (nth 4 syntax)
(forward-char)
(setq syntax (syntax-ppss (point)))))
@hober
hober / spec-toggle.js
Created Mar 27, 2012
Bookmarklet for toggling between sections of the WHATWG and W3C versions of the HTML5 spec
View spec-toggle.js
// javascript:(function()%7b%20%20%20%20%20var%20prefix%3b%20%20%20%20%20var%20hash%20%3d%20window.location.hash%3b%20%20%20%20%20var%20specpart%20%3d%20window.location.pathname.split(%22%2f%22)%3b%20%20%20%20%20specpart%20%3d%20specpart%5bspecpart.length-1%5d%3b%20%20%20%20%20if%20(window.location.hostname%3d%3d%22www.whatwg.org%22)%20%7b%20%20%20%20%20%20%20%20%20prefix%20%3d%20%22http%3a%2f%2fdev.w3.org%2fhtml5%2fspec%2f%22%3b%20%20%20%20%20%7d%20else%20%7b%20%20%20%20%20%20%20%20%20prefix%20%3d%20%22http%3a%2f%2fwww.whatwg.org%2fspecs%2fweb-apps%2fcurrent-work%2fmultipage%2f%22%3b%20%20%20%20%20%7d%20%20%20%20%20window.location%20%3d%20prefix%20%2b%20specpart%20%2b%20hash%3b%20%7d)()%3b%20
(function(){
var prefix;
var hash = window.location.hash;
var specpart = window.location.pathname.split("/");
specpart = specpart[specpart.length-1];
if (window.location.hostname=="www.whatwg.org") {
prefix = "http://dev.w3.org/html5/spec/";
} else {
@hober
hober / gist:3969117
Created Oct 28, 2012
Emacs function to fix fantasai's right hand being off-by-one when scribing.
View gist:3969117
(defun right-hand-querty-correct (b e)
"Fix fantasai's right hand being off by one."
(interactive "r")
(let ((right-hand-keys "
67890-=
yuiop[]\\
hjkl;'
bnm,./"))
(goto-char b)
(while (not (= (point) e))
View demo-without-angular.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Radar 22169467</title>
<script>
function log(text) {
var logEl = document.getElementById("log");
logEl.innerHTML = logEl.innerHTML + text + "<br>";
}
View Wii.md

Hi. I would like to sell someone my Wii. Here's what I have:

Hardware

  • Nintendo Wii (original, GameCube-compatible one) & associated cords including a VGA adapter
  • Wii Remote x2
  • Wii Remote charging stand & battery packs
  • Wii Nunchuk
  • Wii Classic Controller x2
  • Wii Classic Controller for PC USB adapter
  • Wii Balance Board
You can’t perform that action at this time.