Skip to content

Instantly share code, notes, and snippets.

@brettz9
brettz9 / fixed-table-header.css
Last active June 1, 2017 07:27
Boiled down, heavily annotated demo from https://jsfiddle.net/dPixie/byB9d/3/light/ on (relatively) fixed table headers (and footers added); JSFiddle at https://jsfiddle.net/2319nrfp/8/ . See also http://salzerdesign.com/test/fixedTable.html and http://salzerdesign.com/blog/?p=191
/*
Originally from: https://jsfiddle.net/dPixie/byB9d/3/light/
See also http://salzerdesign.com/test/fixedTable.html and http://salzerdesign.com/blog/?p=191
*/
html, body {
height: 100%; /* Needed to ensure descendent heights retain 100%; could be avoided if didn't want percent on table height */
}
@brettz9
brettz9 / console-log.html
Last active March 21, 2017 02:53
Override console methods to include file/line number (and potentially full stack). TODO: Pass suspected suspect line and whole stack with modified content to callback. For background, see http://stackoverflow.com/questions/13815640/a-proper-wrapper-for-console-log-with-correct-line-number/42860910#42860910
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="console-log.js"></script>
</head>
<body>
<script>
function a () {
console.log('xyz'); // xyz (console-log.html:10)
@brettz9
brettz9 / openThunderbirdMail.js
Last active January 1, 2017 01:49
Snippet for use with [Custom Buttons](https://addons.mozilla.org/en-US/thunderbird/addon/custom-buttons/) to open a specific email in Thunderbird from a custom toolbar button.
/*CODE*/
/*
See:
- https://dxr.mozilla.org/comm-central/source/mail/base/modules/
- https://dxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgHdr.idl
- https://searchcode.com/codesearch/view/21378574/ (Gloda)
- https://searchcode.com/codesearch/view/21377672/ (datamodel.js)
- https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMsgDBHdr
- eMarks souce! https://addons.mozilla.org/en-US/thunderbird/addon/emarks/
@brettz9
brettz9 / colors.js
Last active December 29, 2016 23:44
A close substitute for [colors.js](https://github.com/Marak/colors.js) in the browser. See https://jsfiddle.net/fbe4s9ry/ . Plan to move to https://github.com/brettz9/styled-log
const colors = new Proxy({
setTheme: function (theme) {
this._theme = theme;
},
log: function (msgColor) {
console.log(...msgColor);
}
}, {
get: function (target, name) {
if (['setTheme', 'log', '_theme'].includes(name)) {
// ID_Start (includes Other_ID_Start)
shimIndexedDB.__setConfig(
'UnicodeIDStart'
'(?:[$A-Z_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0
@brettz9
brettz9 / command-toolbar.json
Last active April 11, 2016 20:57
Backup of command-toolbar buttons ( %userprofile%/.atom/command-toolbar.json )
{"statePath":"C:\\Users\\brett\\.atom/command-toolbar.json","opened":true,"side":"top","buttons":[["packages","settings-view:view-installed-packages"],["install","settings-view:install-packages-and-themes"],["config","file://C:\\Users\\brett\\.atom\\config.cson"],["styles","file://C:\\Users\\brett\\.atom\\styles.less"],["keymap","file://C:\\Users\\brett\\.atom\\keymap.cson"],["toolbar","file://C:\\Users\\brett\\.atom\\command-toolbar.json"],["snippets","file://C:\\Users\\brett\\.atom\\snippets.cson"],["insert snippet","snippets:available"],["palette","command-palette:toggle"],["git-control","git-control:toggle"],["git-history","git-history:show-file-history"],["npm-scripts","os:npm scripts"],["reveal","os:explorer"],["cmd","os:cmd"],["browser","web-browser:toggle"],["symbols","symbols-tree-view:toggle"],["md-preview","markdown-preview:toggle"],["md-heading","markdown-folder:toggle"]]}
@brettz9
brettz9 / init.coffee
Created March 29, 2016 02:29
Just making a place for my Atom init script
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@brettz9
brettz9 / keymap.cson
Last active December 13, 2022 06:52
Keymap.cson config for Atom
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@brettz9
brettz9 / package-list.txt
Last active March 29, 2021 13:43
Atom (and starred) package list generated by `apm list --bare > package-list.txt` adapted from instructions at https://discuss.atom.io/t/installed-packages-list-into-single-file/12227/2 (I removed the --installed flag to be safe though the list with the flag is in the first comment below; also note that after some installs, they didn't show up i…
atom-dark-syntax@0.29.1
atom-dark-ui@0.53.3
atom-light-syntax@0.29.1
atom-light-ui@0.46.3
base16-tomorrow-dark-theme@1.6.0
base16-tomorrow-light-theme@1.6.0
one-dark-ui@1.12.5
one-light-ui@1.12.5
one-dark-syntax@1.8.4
one-light-syntax@1.8.4
@brettz9
brettz9 / jsonschema.json
Created March 19, 2016 09:34
Sample JSON Schema segment for i18n proposal
{
"localePaths": [
{"#/locales": {
"allowedKeywords": ["title", "enum-titles", "default"]
}},
{"#/localePatterns": {
"order": "l-p-k",
"allowedKeywords": ["pattern"]
}}
],