- http://horseecomics.tumblr.com/image/27379609204
- http://horseecomics.tumblr.com/image/25552871672
- http://horseecomics.tumblr.com/image/25167996330
- http://horseecomics.tumblr.com/image/22763491821
- http://horseecomics.tumblr.com/image/22165855150
- http://horseecomics.tumblr.com/image/21027490676
- http://horseecomics.tumblr.com/image/20099657243
- http://horseecomics.tumblr.com/image/19596427936
- http://horseecomics.tumblr.com/image/18818884633
- http://horseecomics.tumblr.com/image/18237607883
A common pattern is to make sure that undefined
is actually what it says it is, using some kind of wrapper function:
(function(undefined) {
// undefined will be undefined now, even if some idiot overwrote it.
})();
Why you shouldn’t do that:
Here are some guidelines that will make me actually like your amazing new web application!
-
Make sure encoding is handled properly every step of the way. If
’
comes out as’
, you’ve got a problem on your hands. 😊 -
Make it accessible. Turn off images, JavaScript, and CSS. If your website is still legible and usable (it’s okay if it’s just barely usable, or not particularly interactive) then you are already in the top 0.01%.
-
Check your grammar. One of the fastest ways to lose respect in a blog post (or worse — in body copy) is to make basic orthographical or grammatical mistakes. These include, but are not limited to:
- Missing apostrophes — [Bitbucket even did that][bitbucket-apostrophe-catastrophe].
/* | |
* Note: This was a bugfix for http://stackoverflow.com/a/9454335/707111. | |
* I submitted a pull request (https://github.com/flaviosilveira/Jquery-Price-Format/pull/5), | |
* which was ignored. I'm leaving this here so that my answer isn't entirely useless, | |
* but the project has been updated since. | |
* Price Format jQuery Plugin | |
* Created By Eduardo Cuducos cuducos [at] gmail [dot] com | |
* Currently maintained by Flavio Silveira flavio [at] gmail [dot] com |
/** | |
* Absolute positioning for full height | |
*/ | |
body { | |
margin: 0; | |
} | |
#container { | |
background-color: #07f; |
/** | |
* Using a box-shadow to mimic a gradient | |
*/ | |
#item { | |
background-color: #07f; | |
border-radius: 0.2em; | |
box-shadow: inset 0 -1em 1em -0.5em rgba(0, 0, 0, 0.7); | |
color: white; | |
display: inline-block; |
If MsgBox("Are you sure you want to shut down?", vbExclamation Or vbYesNo Or vbDefaultButton2, "Shut down") = vbYes Then | |
Dim wsh : Set wsh = CreateObject("WScript.Shell") | |
wsh.Run "shutdown /s /t 0" | |
End If |
/** | |
* ✎'s "Under Construction" page prototype | |
*/ | |
/* Background | |
-------------------------------*/ | |
body { | |
background-color: #ccc; | |
} |
# https://twitter.com/garybernhardt/status/253708758964903936 | |
def file_parts(filename) | |
parts = filename.split '.' | |
last_spaces = | |
parts.rindex do |part| | |
part.include? ' ' | |
end | |
[parts[0..last_spaces].join('.'), parts[last_spaces+1..-1]] |
/** | |
* Fixed elements that have a right margin relative to a content element | |
* http://stackoverflow.com/q/12469476/707111 | |
*/ | |
html, body { | |
height: 100%; | |
margin: 0; | |
} |