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
/** | |
* Usage: | |
* Go to https://objectedge.slack.com/files/{username} | |
* and run this code in the browser console | |
*/ | |
(function() { | |
var time = new Date().getTime(); | |
var url = { | |
list: "/api/files.list?t=" + time, | |
del: "/api/files.delete?t=" + time |
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
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
import pubsub from 'pubsub'; | |
import spinner from 'spinner'; | |
import ccLogger from 'ccLogger'; | |
export default { | |
onLoad() { | |
const occDebugger = this._occDebugger; | |
occDebugger.debug('spinner'); | |
occDebugger.debug('topics'); |
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
const getLastDigits = (cardNumber = '') => { | |
const match = cardNumber.match(/(?<lastDigits>\d{4})$/); | |
return match && match.groups.lastDigits || false; | |
} |
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
PinchZoom.prototype.getContainerCenter = function () { | |
var centerX = this.container.offsetLeft + this.container.offsetWidth / 2; | |
var centerY = this.container.offsetTop + this.container.offsetHeight / 2; | |
return { | |
x: centerX, | |
y: centerY, | |
}; | |
}; |
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
import first from 'lodash/first' | |
import last from 'lodash/last' | |
import inRange from 'lodash/inRange' | |
export function createPagination(items, current, delta) { | |
const currentIndex = items.indexOf(current) | |
const left = currentIndex - delta | |
const right = currentIndex + delta + 1 | |
const applyDots = (data, item, lastItem) => { |
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
/** | |
* Reads a XML file and converts its content into a ds_map | |
* | |
* Example output: | |
* | |
* <ds_map>{ | |
* type: "root", | |
* content: "", | |
* nodes: <ds_list>[ | |
* <ds_map>{ |
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
varying vec2 v_vTexcoord; | |
varying vec4 v_vColour; | |
varying vec3 v_vPosition; | |
uniform vec4 u_bounds; | |
void main() { | |
vec4 color = v_vColour * texture2D(gm_BaseTexture, v_vTexcoord); | |
// calculate alpha | |
color.a *= float( |
OlderNewer