Tags
array bash benchmark cli compose compose key configuration css diy editorial firefox fixes gotcha hack hardware html5 input javascript jquery jsperf keyboard linux mouse multi touch multitouch nginx opera performance preferences prototype ruby sameheight snippet special characters ssh style syntax touchpad touch pad trackpad track pad ubuntu w3c web standards wiiCategories
-
Recent Posts
Recent Comments
- Lashell on Defining Functions Inline Is Just Fine
- Christian Iversen on JavaScript Performance: Iterating over Arrays with Holes
- force on JavaScript Performance: Iterating over Arrays with Holes
- Christian Iversen on JavaScript Performance: Iterating over Arrays with Holes
- force on Delete a Line from a File by Its Line Number
Archives
Meta
Author Archives: force
Run Sinatra App in a Subdirectory with Rack::Builder.map
Thank god I found Tanner Burson’s blog. I was about to explode. I recommend reading Tanner’s original post, but the short answer is that you want Rack to do some routing for you via Rack::Bundler.map. Here is a super simple … Continue reading
That’s Profiling!
I want to see if one string exists in another, case-insensitive. What’s faster? Making the strings both lower case then comparing them with String.match? Comparing the first string to a case-insensitive regular expression of the other? Making them both lower … Continue reading
Are You Still There?
A scenario: you want to update some content on your page periodically, but you don’t want to waste requests, resources, cycles, etc. on running your script while the user is obviously not interacting with the page. What do you do? … Continue reading
Posted in javascript
Tagged awake, blur, focus, interval, javascript, jquery, periodic, setinterval, sleep, user interface
Leave a comment
Add Stable Merge Sort to Array and jQuery Prototypes
Some browsers’ JavaScript implementations don’t implement a stable sort, but stable sorting can be so handy if you want to, say, sort a table by multiple columns. So here’s a quick and easy way to add an efficient, stable merge … Continue reading
Posted in javascript
Tagged array, extend, javascript, jquery, merge sort, mergesort, prototype, sort, sorting, stable sort, stable sorting
Leave a comment
Request Tracker Watchdog
I recently upgraded from Request Tracker 3.8.0 to 4.0.2 and started running it with FastCGI. Works great except for the odd Bad Gateway message from nginx (still haven’t figured that one out). While v4 makes a lot of improvements over … Continue reading
Beyond setTimeout: Delay Your JavaScript with Closures
Have you ever wanted to delay something with JavaScript? So, of course, you look to window.setTimeout. But maybe this is interactive, or you want to be able to interrupt it? Then you save a reference to it, and you pass … Continue reading
Posted in javascript
Tagged accumulator, closure, delay, function object, functional, functionoid, functor, javascript, state, timeout
Leave a comment
Delete a Line from a File by Its Line Number
I keep having this problem. You know how ssh will tell you when the host’s keys have changed? For example, you try to ssh to example.org $ ssh example.org and you get @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! … Continue reading
Running Rails 2.3.14 on Ruby 1.9.2
While trying to run Rails 2.3.14 on Ruby 1.9.2, I was getting an error page with ActionView::TemplateError (invalid byte sequence in US-ASCII) Turns out Rails 2.3.14 on Ruby 1.9.2 was trying to read my UTF-8 data as US-ASCII. Solution Don’t … Continue reading
Run Wireshark as Non-Privileged User in Ubuntu
This has been annoying me for a while, so I researched it. I wrongfully submitted a bug to Launchpad, and finally was directed to an answer. It was bugging me that there was no simple way to add a gksu … Continue reading
Augmenting Intelligence?
I read (most of) this book called What the Dormouse Said: How the Sixties Counterculture Shaped the Personal Computer Industry, and it discussed this really neat idea of computers as augmenting human intelligence. It’s not so much that we use … Continue reading
Posted in editorials
Tagged augmented intelligence, brain, education, intelligence, thinking
Leave a comment