// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 6) then: | |
// ie === 0 | |
// If you're in IE (>=6) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
The code examples are actually taken directly from an early version of DocPad before and after tha javascript rewrite. We now handle these cases a lot better in terms of callback hell by utilising task groups with bal-util, however the issue of the readability and error proneness of the verbose syntax in javascript is key these code examples.
There is also a larger issue that I see at the core of JavaScript, which is detailed in the following email response:
Question: Would ES6's implementation of easier classes in JavaScript, make you consider moving back to JavaScript from CoffeeScript?
Answer: Well there are lot more issues in JavaScript than its current complexity with writing code.
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
A listing of all the nifties that people have come up with for DocPad.
Now maintained on the DocPad Website's Plugins Page under "Nifties"
I write Node.js libraries, and I want logging. Why is this so problematic?
Note, I am despairing about how library authors log stuff not how application builders decide on a logging framework.
Hopefully this document can become a spec or feature list for code I will write some day.
The docpad-plugin-ghpages
uses the following information to stitch a new repo with contents of ./out
directory onto root of your gh-pages
branch:
git config user.email
git config user.name