HNHacker News
TopNewBestAskShowJobs

craigc

1,348 karma · joined March 26, 2012

http://craig.is
submissionscomments
craigc··on Mousetrap: Keyboard shortcuts in Javascript
This offers a few additional things such as supporting Gmail style key sequences, binding keyup events, supporting keys that require the shift modifier using their key name "?", triggering key commands programmatically, etc.
craigc··on Mousetrap: Keyboard shortcuts in Javascript
Ah good idea! I will add those on the demo page later.
craigc··on Mousetrap: Keyboard shortcuts in Javascript
What browser are you using? It works correctly for me using Chrome on Mac. Could you make a ticket on Github?
craigc··on Mousetrap: Keyboard shortcuts in Javascript
Thanks! Command is bound to e.metaKey so whatever that works out to on PC, but you can specify multiple keys like in the next example, by passing an array.
craigc··on ChromePHP - PHP Console Logging in Google Chrome
I made this a while ago, but thought I'd share it here in case anyone is interested. Technically it can support any language but it would require a header set server side with the encoded data to be logged.
craigc··on Rainbow.js - code syntax highlighting in 1.2kb
That's actually how I started this project! I started working on making a syntax highlighter that could pull in TextMate tmLanguage files, but then I ran into a lot of issues and decided to spin it off into this :)

That is why the syntax in Rainbow is pretty similar.

The main problem had to do with Javascript regex not fully supporting everything that most languages support such as negative/positive lookbehinds and (.*)

craigc··on Rainbow.js - code syntax highlighting in 1.2kb
Yeah I just have to make Rainbow.init() public and make it ignore blocks that have already been processed. Then this will work. Feel free to make a ticket for me on https://github.com/ccampbell/rainbow/issues
craigc··on Rainbow.js - code syntax highlighting in 1.2kb
This is because I'm using Google Closure Compiler in advanced mode so all methods that do not get used get renamed.

In order to preserve the methods and keep them public you have to reference them like this.

← PreviousPage 8 of 8