This file contains hidden or 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
| #macro ENCRIPTION_KEY "your-encryption-key" | |
| function xorcrypt_buffer(_buff) { | |
| var _key = ENCRIPTION_KEY; | |
| var _key_len = string_byte_length(_key); | |
| var _size = buffer_get_size(_buff); | |
| // Iterate through the buffer and XOR every byte | |
| for (var i = 0; i < _size; i++) { | |
| var _byte = buffer_peek(_buff, i, buffer_u8); |
This file contains hidden or 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
| function seconds_to_gamespeed(_seconds) { | |
| return game_get_speed(gamespeed_fps) * _seconds; | |
| } | |
| /** | |
| * new Timer(_bind, _callback) | |
| * @param _bind scope of the callback, usually the | |
| * @param _callback function to be executed | |
| * | |
| * Methods |
This file contains hidden or 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( |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) }; |
NewerOlder