I hereby claim:
- I am dannzzor on github.
- I am dannzzor (https://keybase.io/dannzzor) on keybase.
- I have a public key ASD-HJwJaC1_QyGcQurv8NX7WqKutGv4Km2jUhboSXhMNgo
To claim this, I am signing this object:
/* Find the largest product of factors for a given number. | |
* ie, if you split a number into segments, then multiply those segments, | |
* find the largest possible product of all the possible segment sizes | |
* and return the array of segments | |
*/ | |
function bestFactors(num) { | |
const rem = num%3; | |
return num > 3 ? [ | |
...(rem ? [ ...Array(3-rem) ].map(() => 2) : []), | |
...[...Array( (num - (rem ? ((3-rem) * 2) : 0)) / 3)].map(() => 3) |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
* { | |
background: #2a2d36!important; | |
border-color: #b7bdd2!important; | |
color: #86b2de !important; | |
} | |
a { | |
color: #a374ef!important; | |
} |
{ | |
"Enhanced import": { | |
"prefix": "impp", | |
"body": [ | |
"import { $2 } from '$1';", | |
"$3" | |
], | |
"description": "Type `impp` then hit tab, then enter the source, hit tab again, then enter what part you wish to import. This way you get autocomplete on the exported methods!" | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
function leftPad(str, len, fil) { | |
return new Array(len - str.length +1).join(fil || 0) + str; | |
} |
// tokenize(str) | |
// extracts semantically useful tokens from a string containing English-language sentences | |
// @param {String} the string to tokenize | |
// @returns {Array} contains extracted tokens | |
function tokenize(str) { | |
var punct='\\['+ '\\!'+ '\\"'+ '\\#'+ '\\$'+ // since javascript does not | |
'\\%'+ '\\&'+ '\\\''+ '\\('+ '\\)'+ // support POSIX character | |
'\\*'+ '\\+'+ '\\,'+ '\\\\'+ '\\-'+ // classes, we'll need our |
; // jQuery material easing | |
jQuery.extend( jQuery.easing, | |
{ | |
easeInOutMaterial: function (x, t, b, c, d) { | |
if ((t/=d/2) < 1) return c/2*t*t + b; | |
return c/4*((t-=2)*t*t + 2) + b; | |
} | |
}); |
/* | |
* ======================================================================================== | |
* DRD.js | |
* Vx.x.a | |
* Created: 26 July 2014 | |
* Created by: DRD | |
* ---------------------------------------------------------------------------------------- | |
* Update log: (please log any changes you make!) Example: Version# - Date - Name - updates | |
* Vx.x.a - 29 July 2014 - DRD - Converted the former DRD.js to the new structure of DRD.js | |
* |
/* Knuth-Morris-Pratt algorithm | |
* | |
* best for limited alphabet, such as DNA matching | |
* | |
* | |
*/ | |
function matchKMP(str, keyword) { | |
var i = 1, |