Skip to content

Instantly share code, notes, and snippets.

@loveencounterflow
loveencounterflow / test-stacktrace.coffee
Created May 7, 2013 22:32
**testing for interaction between longjohn, coffeenode-stacktrace, q, process.on 'uncaughtException' and coa**. test 1 runs as expected; event handler is called, longjohn optionally delivers long stacktrace, so q should be fine. but in test_2 (when called as ``coffee test-stacktrace f``), although longjohn manages to deliver long stacktrace, eve…
# require 'coffeenode-stacktrace'
# require 'longjohn'
log = console.log
fs = require 'fs'
Q = require 'q'
coa = require 'coa' # https://github.com/veged/coa
process.on 'uncaughtException', ( error ) =>
zero
one
two
three
four
five
six
seven
eight
nine
############################################################################################################
### % [ title ] ( src ) ###
video_matcher = /^%\[([^\]]*)\]\s*\(([^)]+)\)/
#-----------------------------------------------------------------------------------------------------------
parse_video = ( state, silent ) ->
return false if state.src[ state.pos ] isnt '%'
match = video_matcher.exec state.src[ state[ 'pos' ] .. ]
return false unless match?
unless silent
@loveencounterflow
loveencounterflow / fill-and-read-db.js
Last active August 29, 2015 14:13
`lte` key limits in LevelDB and Unicode
// Generated by CoffeeScript 1.8.0
(function() {
var $, D, db, db_route, feed, fs, gte, keys, log, new_db, read, rmrf, rpr, through2;
fs = require('fs');
log = console.log;
rpr = (require('util')).inspect;
@loveencounterflow
loveencounterflow / browser.coffee
Created March 13, 2015 14:15
Rendered pixels differ from nominal pixels
( $ 'document' ).ready ->
log = console.log.bind console
nominal_line_height = 25
line_count = 36
panel = $ '.panel'
cork = $ '.cork'
panel_rectangle = panel[ 0 ].getBoundingClientRect()
cork_rectangle = cork[ 0 ].getBoundingClientRect()
real_panel_height = panel_rectangle[ 'height' ]
real_cork_bottom = cork_rectangle[ 'bottom' ]
@loveencounterflow
loveencounterflow / index.html
Last active August 29, 2015 14:17
Strange display error: Google Chrome (OSX) with Unicode CJK Unified Ideographs Extension B (but not C)
<!DOCTYPE html><html>
<head>
<meta charset="utf-8">
<title>font-face-test</title>
<style>
@font-face {
font-family: 'cjk';
src: local('Sun-ExtA');
unicode-range: U+4e00-9fff;
@loveencounterflow
loveencounterflow / Weird Chinese Characters
Last active December 9, 2023 09:18
Little excerpt from my CJK character collections
weird:
...-emoticon:
...-emoticon-frowning-face: 囧
...-emoticon-frowning-king: 崮
...-emoticon-frowning-queen: 莔
...-emoticon-frowning-withhat: 商
...-emoticon-frowning-turtle: 囧興
...-emoticon-bomberman: 卣
...-emoticon-verydull: 槑
...-arbitrary: 𠖬𠄓𠔇𦫺𦫷𦫻𠄑𠦑𠅂𢀗𠃟𨱘𠇬𥎨𠛷𠃡𡭡𡉵𠮸𠅑
@loveencounterflow
loveencounterflow / pg-error-fail-illegal-regex.sql
Last active March 22, 2018 21:03
Three Examples where PostgreSQL has Horrible Error Messages
drop schema if exists X cascade;
create schema X;
create domain X.an_illegal_regex as text check ( value ~ '(' );
create table X.table_with_illegal_constraint (
a text,
constraint "column a must have a bogus value" check ( a::X.an_illegal_regex = a ) );
@loveencounterflow
loveencounterflow / benchmarks-raw.coffee
Created February 23, 2020 11:11
JavaScript Performance Benchmarks: Looping with `for` and `yield`
'use strict'
############################################################################################################
log = console.log
warn = console.warn
fn = ( new Intl.NumberFormat 'en-US' ).format
@loveencounterflow
loveencounterflow / opera-mac-internal-pages-and-more.md
Created May 13, 2020 07:31 — forked from christopheranderton/opera-mac-internal-pages-and-more.md
A list of internal (and external) pages and useful information for macOS/OS X users (and others) of the Chromium/Blink based version of the web browser Opera.

Opera Development Icon