What's the best thing you can write using only valid + existing npm module names?
https://www.npmjs.com/package/i/
https://www.npmjs.com/package/only/
https://www.npmjs.com/package/speak/
https://www.npmjs.com/package/in/
var _ = require('lodash'); | |
var React = require('react'); | |
module.exports = React.createClass({ | |
displayName: 'TextWithLineBreaks', | |
render: function () { | |
var nodes = []; | |
var fragments = this.props.text.split('\n'); | |
var key = 0; |
What's the best thing you can write using only valid + existing npm module names?
https://www.npmjs.com/package/i/
https://www.npmjs.com/package/only/
https://www.npmjs.com/package/speak/
https://www.npmjs.com/package/in/
struct state { | |
struct wakelock wakelock; | |
} | |
init() { | |
wake_lock_init(&state->wakelock, WAKE_LOCK_SUSPEND, "wakelockname"); | |
} | |
Before freeing the memory, wake_lock_destroy must be called: | |
uninit() { | |
wake_lock_destroy(&state->wakelock); | |
} |
This is a companion Gist for a talk that I gave at React Berlin in April 2015. The fine folks at Bitcrowd recorded all three of the evening's talks, so you can watch mine at https://www.youtube.com/watch?v=9ArhJiMGVDc.
Peter Magenheimer (@peterjmag)
I'm a front end developer at ResearchGate. And yes, we're hiring.
diff --git parker.js parker.js | |
index 48fa2fd..5d9b05b 100755 | |
--- parker.js | |
+++ parker.js | |
@@ -25,6 +25,10 @@ cliController.on('runPaths', function (filePaths) { | |
var stylesheets = []; | |
async.each(filePaths, function (filePath, onAllLoad) { | |
var onFileLoad = function (err, data) { | |
+ if (err) { | |
+ console.log(err); |
/* | |
* Visit http://benzguo.com/bayan/ and paste this in your console. | |
* | |
* Originally from https://news.ycombinator.com/item?id=8217872, adapted | |
* to handle non-alpha characters like commas and semicolons. | |
*/ | |
// SETTINGS | |
// var input = "rsa ecde srgu yhgr bv rsa ecde srgu yhgr bv hybtg ser erv"; | |
// input += " hybtg iii r hybtg ser erv tvr rrr rvgres rrr rvg rrr rvgres "; |
Anything added dilutes everything else. | |
Approachable is better than simple. | |
Avoid administrative distraction. | |
Design for failure. | |
Encourage flow. | |
Favor focus over features. | |
Half measures are as bad as nothing at all. | |
It's not fully shipped until it's fast. | |
Keep it logically awesome. | |
Mind your words, they are important. |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
letters-to-100.py | |
""" | |
import string | |
letter_values = dict((l, i) for i, l in enumerate(string.lowercase, start=1)) | |
english_dict = open('/usr/share/dict/words', 'rU') |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
reddit-comment-depth.py | |
Created by peterjmag on 2011-12-30. | |
""" | |
import urllib2 | |
import simplejson as json |