-
jq — https://jqlang.github.io/jq/ — "like sed for JSON data"
There are several options available for installing jq. I prefer to use Homebrew:
brew install jq
Components are an integral part of react. Every part or a react app, from an individual list item, to the app itself is setup as a component. there are a few ways to think about the structure of a component, and your major choices are: Class Component, or Function Component. React Docs on Components and Props
the render function is made to determine what should be rendered to the dom, when the component is used. you should use a return block to set what will be returned from running render. This function is a requirement of a Component.
Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.
My 3 developers team has just developed React.js application with 7668
lines of CSS (and just 2 !important
).
During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.
Here are main principles we use to write CSS for modern (IE11+) browsers:
- SUIT CSS naming conventions + SUIT CSS design principles;
- PostCSS + CSSNext. Future CSS syntax like variables, nesting, and autoprefixer are good enough;
- Flexbox is awesome. No need for grid framework;
- Normalize.css, base styles and variables are solid foundation for all components;
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
var deleteAllGroupMembers = (function () { | |
var deleteAllGroupMembers = {}; | |
// the facebook ids of the users that will not be removed. | |
// IMPORTANT: add your own facebook id here so that the script will not remove yourself! | |
var excludedFbIds = ['1234','11223344']; // make sure each id is a string! | |
var usersToDeleteQueue = []; | |
var scriptEnabled = false; | |
var processing = false; | |
deleteAllGroupMembers.start = function() { |
/** | |
* Move all data in one field to another. | |
* In the example below we replace a multi cardinality field (field_old_field) | |
* with a single cardinality field (field_new_field). | |
* The data in the first element of the old field becomes the only data in the new field. | |
* | |
* @requires entity module | |
*/ | |
function mymodule_update_7001(&$sandbox) { | |
if (!isset($sandbox['progress'])) { |
In the past four years, I've learned the hard way about how painful it can be to try and update a codebase used by a large number of applications. Changes that seem innocent can break a specific use case that wasn't anticipated. Do enough manual regression testing and you will catch the bugs, but it's' costly and time consuming process. When things are costly and time consuming, they usually stop being done.
This is why I focus a lot of my efforts towards build process automation. Computers are fantastic about doing boring, repetitive work and never complaining. If you can get them to do the boring chores for you, you spend more time doing the fun, challenging work.
UI Regression testing is one of those spots where I'm looking for automation scripts to take over. Not only because playing "spot the difference" between your builds is boring, but also because [we're horrible at it](http://en.wikipedia.org/wiki/Chan
<?php | |
/** | |
* @Given /^I am viewing a product with the following related products:$/ | |
*/ | |
public function assertRelatedProducts(TableNode $relatedProducts) { | |
// First, create a product. | |
$product = (object) array( | |
'title' => 'Parent Product', | |
'type' => 'product', | |
'uid' => 1, |
; Drush Makefile for Drupal | |
; Wysiwyg with CKEditor 4.0.1 | |
projects[wysiwyg][version] = 2.2 | |
projects[wysiwyg][patch][1853550] = http://drupal.org/files/wyiwyg-support_v4_ckeditor-1853550-42.patch | |
libraries[ckeditor][download][type] = file | |
libraries[ckeditor][download][url] = http://download.cksource.com/CKEditor/CKEditor/CKEditor%204.0.1/ckeditor_4.0.1_full.zip | |
libraries[ckeditor][download][md5] = d47c37acf2d03ffe6ad39f55e00b099b |