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
| export const isPalindrome = string => | |
| string.split('').reverse().join('') === string; |
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
| // Usage: | |
| // node delete-random-lines.js some-file.txt | |
| require('fs').readFile(process.argv[2], 'utf-8', (err, file) => { | |
| const lines = file.split('\n'); | |
| const linesToDelete = Math.round(lines.length * 0.1); | |
| for (let i = 0; i < linesToDelete; i++) | |
| lines.splice( | |
| Math.floor(Math.random() * lines.length), |
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
| // Usage: | |
| // node delete-random-lines.js some-file.txt | |
| const fs = require('fs'); | |
| const lines = fs.readFileSync(process.argv[2], 'utf-8').split('\n'); | |
| const lineToDelete = Math.round(lines.length * 0.1); | |
| for (let i = 0; i < lineToDelete; i++) { | |
| lines.splice( |
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
| /* globals PluginManager, SceneManager, Scene_Load, DataManager */ | |
| /*: | |
| * @plugindesc Autoload a saved game when the game boots | |
| * @param File ID | |
| * @desc The 1-based index of the file to load | |
| * @default 1 | |
| * @author Jeremy Kahn | |
| */ | |
| (function () { | |
| 'use strict'; |
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
| /* globals SceneManager */ | |
| /*: | |
| * @plugindesc Auto start a new game when the game boots | |
| * @author Jeremy Kahn | |
| */ | |
| (function () { | |
| function poll () { | |
| if (SceneManager._scene && SceneManager._scene.commandNewGame) { | |
| SceneManager._scene.commandNewGame(); | |
| } else { |
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
| /*: | |
| * @plugindesc A utility for easily calling JavaScript files from events | |
| * @author Jeremy Kahn | |
| * | |
| * @help API: exec('path/to/script', arg1, arg2, ...); | |
| * | |
| * * You may add on as many arguments as you need. | |
| * * The path is relative to project-root/js | |
| * * Loaded files must be AMD modules that looks like so: | |
| * |
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
| for FILE in `ls`; do sass-convert $FILE > `echo $FILE | sed s/scss/sass/`; done |
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
| #!/bin/bash | |
| COMPONENTS_PATH="app/scripts/components" | |
| TEMP_FILE="/tmp/temp.js" | |
| for COMPONENT in `ls $COMPONENTS_PATH`; do | |
| COMPONENT_PATH="$COMPONENTS_PATH/$COMPONENT" | |
| git mv $COMPONENT_PATH/main.js $COMPONENT_PATH/$COMPONENT.js | |
| git mv $COMPONENT_PATH/view.js $COMPONENT_PATH/$COMPONENT-view.js | |
| git mv $COMPONENT_PATH/template.mustache $COMPONENT_PATH/$COMPONENT-template.mustache |
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
| { | |
| "savedAnimations": { | |
| "__transientAnimation": { | |
| "actorModel": { | |
| "transformPropertyCollection": [ | |
| { | |
| "x": 50, | |
| "y": 489, | |
| "millisecond": 0, | |
| "isCentered": true, |
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
| /* global console: true */ | |
| var module = (function () { | |
| function privateFn () { | |
| console.log('I am a private function!'); | |
| return 8; | |
| } | |
| var privateVar; | |
| return { |