See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
//Run this from /admin/orders/. Paste it into the javascript console and press enter. | |
function delete_all() | |
{ | |
l = $("[name*=order_ids_]"); | |
console.log("Found "+l.length+" checkboxes"); | |
for(i=0; i<l.length; i++) | |
{ | |
name = $(l[i]).attr("name"); | |
if(name.indexOf("order_ids_") > -1) | |
{ |
import React, { PropTypes } from 'react'; | |
import styled from 'styled-components' | |
const Wrapper = styled.div` | |
// styles here that used to be for .test | |
` | |
const Label = styled.label` | |
// label styles here | |
` |
{ | |
"consumer": { | |
"name": "Front Commerce" | |
}, | |
"provider": { | |
"name": "Magento 2 Url" | |
}, | |
"interactions": [ | |
{ | |
"description": "A find request for entity with type category and id 6", |
has_no_paypal_tag = Input.cart.line_items.any? { |line_item| line_item.variant.product.tags.include?('no-paypal') } | |
if has_no_paypal_tag | |
Output.payment_gateways = Input.payment_gateways.delete_if { |payment_gateway| payment_gateway.name.include?("PayPal") } | |
else | |
Output.payment_gateways = Input.payment_gateways | |
end |
const fs = require('fs'); | |
const path = require('path'); | |
const moment = require('moment'); | |
const json = require('./greg-babiarss-blog.ghost.2017-05-13.json'); | |
json.data.posts | |
.filter(p => p.status === 'published') | |
.forEach(({title, slug, published_at: published, markdown}) => { | |
const date = moment(published).format('YYYY-MM-DD'); | |
const content = |
Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.
// All non-merge commits | |
reg = /^(.+?)(\n|$)/; ' * ' + Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title && title.indexOf('Merge') !== 0).map(title => { var mm = title.match(reg); return mm && mm[1]; }).join("\n * "); | |
// Only merge commits | |
reg = /^[^#]+(#[0-9]+)[^\n]+\n\n((?:.|\n)+)$/; Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title.indexOf('Merge') === 0).map(title => { var mm = title.match(reg); return mm && mm[2] + ' (' + mm[1] + ')'; }).join("\n * "); |
<?php | |
/** | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
* @author Phuong LE <[email protected]> <@> | |
* @copyright Copyright (c) 2017 Agence Soon (http://www.agence-soon.fr) | |
*/ | |
namespace MyVendor\MyModule\Observer; | |