Add "precommit"
script into package.json
npx mrm lint-staged
/** | |
* Assign value to the context by key path | |
* @param {array} path ['foo', 'bar'] | |
* @param {mixed} value | |
* @returns {*} result {foo:{bar: value}} | |
*/ | |
function _define (path, value){ | |
return path.reduce((x, y, i) => { | |
return x[y] = i === path.length - 1 && typeof value !== 'undefined' ? value : x[y] || {}; | |
}, this) |
// Works out the width of elements based | |
// on total number of columns and width | |
// number of columns being displayed. | |
// Values for @grid would be 12, 16 or 24 | |
.grid-inline-block(@grid: 12, @margin: 0, @width: 100%) { | |
@actions: column, prefix, suffix, pull, push; | |
.grid-action(block){ | |
display: inline-block; | |
vertical-align: top; |
<?php | |
$url = 'http://www.cbr.ru/scripts/XML_daily.asp'; | |
$ch = curl_init( $url ); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$result = curl_exec( $ch ); | |
curl_close($ch); | |
$xml = new SimpleXMLElement($result); |
t=this.open(); | |
t.addEventListener('DOMContentloaded',(e)=>{ | |
console.log(this, e); | |
e.target.close(); | |
}); | |
t.dispatchEvent(new CustomEvent('DOMContentloaded')); |
<body><script>eval('!function(t,i,s,h,n,o,e,a,r){function f(){var t=this.contro\ | |
ls,i=this.id=this.id||(1e17*Math.random()).toString(32);this.I=function(s){for(\ | |
var h in t)s.which===t[h]&&dispatchEvent(new Event(h+i))},this.A()}function p(t\ | |
){return function(){var i,s=this.controls,h=this.id;for(i in s)t(i+h,this[i].bi\ | |
nd(this));t(\"keydown\",this.I)}}function l(i){this.h=this.g=0,s(this,i),this.x\ | |
=this.g,this.y=this.h,this.path=new t(this.d),f.apply(this,arguments),this.move\ | |
To()}function u(){l.apply(this,arguments)}function d(){clearInterval(this.m),th\ | |
is.i()}function y(){l.apply(this,arguments)}function v(){l.apply(this,arguments\ | |
),this.o()}function b(t){var c=i.body.appendChild(i.createElement(\"canvas\"));\ | |
s(this,t),c.height=1.5*(c.width=170),this.a=[],this.b=c.getContext(\"2d\"),f.ap\ |
var a = [5,3,7,1,10,-1]; | |
quicksort.call(a); | |
console.log(a); // -1, 1, 3, 5, 7, 10 |
var d = 'M100,35c0-13-11-25-25-25s-25,12-25,18c0-5-11-18-25-18s-25,11-25,25c0,20,36,49,50,62,14-14,50-43,50-62z'; | |
var pd = new PathData(); | |
pd.fromString(d); | |
pd.scale(2) | |
pd.toString() |