A lot of times I'll see developers author a component like this:
const Component = ({shouldShowSomething}) => {
return (
<div>
<div>Some Elements</div>
{ shouldShowSomething ? <div>Something</div> : null }
</div>
);
// swap the keybindings for paste and paste_and_indent | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" } |
var q = require('q'); | |
var Schema = require('jugglingdb').Schema; | |
var schema = new Schema('postgres', { | |
database: 'woonketwong', | |
username: 'woonketwong' | |
}); | |
// The first argument to schema.define is the table | |
// and schema name. Do not use any capital letter | |
// in the table name because the database create table |
var selectionRank = function(array, rank){ | |
// randomly select a pivot | |
var pivotIndex = Math.floor( (Math.random() * array.length) ); | |
var pivot = array[pivotIndex]; | |
// left array stores the smallest <rank> elements in the array | |
var leftArr = []; | |
var rightArr = []; | |
// partition into left and right arrays | |
for (var i = 0; i < array.length; i++){ |
// Run this from your browser console on your meetup event page (http://www.meetup.com/AngularJS-Utah/events/183104032/) | |
(function () { | |
// Query document for attendees and select a random one | |
const list = document.querySelector('ul.attendees-list').children, | |
item = list[Math.floor(Math.random() * list.length)], | |
name = item ? item.querySelector('h4.text--bold').innerText : 'N/A'; | |
// Remove item so they can only be selected once | |
item && item.parentNode.removeChild(item); | |
A lot of times I'll see developers author a component like this:
const Component = ({shouldShowSomething}) => {
return (
<div>
<div>Some Elements</div>
{ shouldShowSomething ? <div>Something</div> : null }
</div>
);
My friend Michael Jackson turned off github issues on one of his smaller projects. It got me thinking...
Maintainers getting burned out is a problem. Not just for the users of a project but the mental health of the maintainer. It's a big deal for both parties. Consumers want great tools, maintainers want to create them, but maintainers don't want to be L1 tech support, that's why they
import React from 'react'; | |
const toPromise = (load) => (new Promise((resolve) => ( | |
load(resolve) | |
))); | |
class LazilyLoad extends React.Component { | |
constructor() { | |
super(...arguments); |