As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
Related: [Why you don't need jQuery as an abstraction][2]
$
itself is a god object. Everything goes on it. The standard plugin / extension architecture that is recommended is to just bolt more methods on $
itself!
Surely this is bad. An example would be how we have both $.load
which is overloaded to do completely different things. If they were on two separate sensibly named objects $Container.load
and $EventTarget.load
. Personally I would deprecate the latter in favour of .on('load'
The animation should be it's own little modular thing, not bolted onto $
. Ajax should be it's own little modular thing, not bolted onto $
// Given a query string "?to=email&why=because&first=John&Last=smith" | |
// getUrlVar("to") will return "email" | |
// getUrlVar("last") will return "smith" | |
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/ | |
function getUrlVar(key){ | |
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); | |
return result && unescape(result[1]) || ""; | |
} |
So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.
You get a hold on such a prime beast like this:
* A Short but smart tutorial on basic pathfinding - http://ai-depot.com/Tutorial/PathFinding.html | |
* http://www.html5rocks.com/en/tutorials/webaudio/games/ | |
CSS Pro Tip |
▄︻┻═┳ - - - - - - - - - - - O | |
guess what? /|\ | |
your code makes me want to shoot myself... / \ |
function has3d(){ | |
if (!window.getComputedStyle) { | |
return false; | |
} | |
var el = document.createElement('p'), | |
has3d, | |
transforms = { | |
'webkitTransform':'-webkit-transform', | |
'OTransform':'-o-transform', |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
define(function () { | |
function getAllPaths() { | |
return [{ | |
path: "", | |
url: "ui/notifications", | |
callback: function (notifications) { | |
notifications.init() | |
} | |
}, { | |
path: "option=com_community&view=profile", |