- Stephen Belanger—Browserifying Big Projects With Minimal Rage
- Nicolas Bevacqua—Browserify All The Things
- James Halliday—Brick The Web
function F(){} | |
function newApply(ctor, args) { | |
var i, | |
fp = F.prototype = ctor.prototype; // Copy prototype. | |
if(fp) { | |
fp.constructor = ctor; | |
} | |
i = new F; | |
ctor.apply(i, args); // Apply the original constructor. | |
return i; |
var myImage = new Image(); | |
myImage.src = "http://somedomain.com/image2.png"; | |
if (myImage.complete) { | |
//already downloaded | |
} else { | |
//not yet downloaded | |
} |
/** | |
* Lea Verou's CSS Lightbox, taken on webplatform.org | |
* For redistribution purposes | |
* @author Lea Verou <lea@w3.org> | |
*/ | |
#lightbox { | |
visibility: hidden; | |
position: fixed; | |
top: 50%; | |
left: 50%; |
var spawnSync = require('spawn-sync'); | |
var NODE_ENV = process.env.NODE_ENV; | |
var production = (NODE_ENV === 'production'); | |
/** | |
* `npm dedupe` in cwd | |
* @return {undefined} | |
*/ | |
var dedupe = function() { | |
var result; |
This is a work in progress. If I missed something or someone, please let me know!
It's hard to recommend best practices in general without context, but basically, writing clean, readable code with lots of comments, and doing a lot of automated unit testing, followed by an automated build process using ANT or Grunt to concatenate and minify files is a start.
I don't focus much on blogs any more. I focus more on Twitter. If the people I follow there recommend something, I'll go read it. Here's the best of my Twitter list, including developers, conferences, and interesting groups. There are other great developers on Twitter, but these tweet mostly about development:
Imagine a web application that uses multiple CSS frameworks, libraries, components, etc. Class names are bound to conflict. Imagine two libraries: freeform.css and aid.css
<a class="freeform-text--bold freeform-display--block aid aid--focusable">example</a>
<a data-freeform="text--bold display--block" data-aid="focusable">example</a>
const makeRequest = async () => { | |
const value1 = await promise1() | |
const value2 = await promise2(value1) | |
return promise3(value1, value2) | |
} |
var util = require('util'); | |
var exec = require('child_process').exec; | |
function getNpmLinkedPackages (callback) { | |
exec('npm list --global', function (error, stdout, stderr) { | |
if (error) return callback(error); | |
if (stderr.length > 0) return callback(stderr); | |
var pkgs = stdout | |
.split('\n') |