This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.customToFixed = function (digits) { | |
return parseFloat(String(this).replace(new RegExp(`(\\d+\\.\\d{${digits}}).*`), '$1')); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* "string".cuckalize(value) | |
* transform any word into a custom object | |
* | |
* @param {Any} v Variable value | |
* | |
* @return {Object} | |
*/ | |
String.prototype.cuckalize = function (v) { return this.split('').reverse().reduce((p, c) => ({ [c]: p }), v) }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#assign foo><@objectToJson object=data.myobj /></#assign> | |
${foo?html} | |
<#macro objectToJson object> | |
<@compress single_line=true> | |
<#if object?is_hash || object?is_hash_ex> | |
<#assign first="true"> | |
{ | |
<#list object?keys as key> | |
<#if first="false">,</#if> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SCRIPT BY WILLIAM LIMA | |
* NAME: CANVAS RETROFFECT | |
* DATE: 08/02/2015 | |
* LANGUAGE: JAVASCRIPT | |
* USAGE: draw_rgb_shift(CanvasElement,EnableRgbShift,EnableScanLine,EnableShine,EnableTvNoise) | |
* USE THE FUNCTION INTO ### AN ANIMATION FRAME ### BUT CREATE IT OUTSIDE | |
*/ | |
var room={height: canvas.height,width: canvas.width,currentTime:0} | |
function draw_rgb_shift(canvas,rgbshift,scanline,shine,noise){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include jquery, momentjs | |
$(function () { | |
var m = moment(); | |
m.lang('es'); // week start on monday | |
var start = m.startOf('week').format('DD'), | |
end = m.endOf('week').format('DD'), | |
month = m.endOf('week').format('MMMM'), | |
afterMonth = start > end ? ' de '+m.startOf('week').format('MMMM') : '', |