See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
_.fromPairs(_.differenceBy(_.entries(original), _.entries(target), ([key, val]) => val)) |
// Kevin Pilard @kpilard Apr 11 16:17 | |
// @jamesxv7 | |
import { Validator } from 'vee-validate'; | |
var app = new Vue({ | |
el: '#app', | |
created () { | |
this.validator = new Validator(this.validationRules) | |
}, |
function jtd_acf_auto_set_license_keys() { | |
if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) { | |
$save = array( | |
'key' => ACF_5_KEY, | |
'url' => home_url() | |
); | |
$save = maybe_serialize($save); |
#!/bin/bash | |
USER=${1:-sebble} | |
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-) | |
PAGES=$((658/100+1)) | |
echo You have $STARS starred repositories. | |
echo |
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php). | |
// Used in conjunction with https://gist.github.com/DanielSantoro/1d0dc206e242239624eb71b2636ab148 | |
// Compatible with WooCommerce 3.0+. Thanks to Alex for assisting with an update! | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
global $woocommerce; | |
ob_start(); | |
?> |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
By the way, I'm available for tutoring and code review :)
new Promise
?.then
callback yet?](https://gist.github.com/joepie91/4c3a10629a4263a522e3bc4839a28c83#6-but#!/bin/bash | |
# | |
# Author: SuperPaintman <[email protected]> | |
# | |
### | |
# Constants | |
### | |
RETVAL=0 |