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
| Array.prototype._sortObj = function(sortProp, sortLH, startAt, endAt) { | |
| var returnArray = this; | |
| if(!sortProp) { | |
| console.error("Sorting property undefined"); | |
| return; | |
| } | |
| var numeric = false; | |
| for(var i = 0; i < returnArray.length; i++) { | |
| if(typeof returnArray[i][sortProp] == undefined) { | |
| console.error("Not all objects have the requested property"); |
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 $n = ( name, appendTo, additionalProps, innerHTML ) => { | |
| const element = document.createElement( name ); | |
| if( typeof appendTo == 'object' ) appendTo.appendChild( element ); | |
| if( typeof appendTo == 'string' ) document.querySelector( appendTo ).appendChild( element ); | |
| if( typeof additionalProps == 'object' ) { | |
| for( const i in additionalProps ) { |
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
| Object.prototype.switch = function( switchTo ) { | |
| if( !switchTo ) return { }; | |
| if( !switchTo[this] && !switchTo.default ) return { }; | |
| if( !switchTo[this] && switchTo.default ) return switchTo.default; | |
| return switchTo[this]; |
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.placeFormat = function( places, limited ) { | |
| if( !places || places < 2 ) places = 2; | |
| if( !limited ) limited = true; | |
| var number = this.toString( ); | |
| if( number.length > places && limited == true ) return number.slice( 0, places - number.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
| // Requires prototype found at https://gist.github.com/ItzArty/96e7439a63ac3800335ecb72a63d255c | |
| console.clear( ); | |
| if( !fs.existsSync('./logs') ) fs.mkdirSync('./logs'); | |
| var d = new Date( ); | |
| var logName = d.getDate( ).placeFormat( 2 ) + '-' + ( d.getMonth( ) + 1 ).placeFormat( 2 ) + '-' + d.getFullYear( ); |
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
| var lastOwnProcessID = 0; | |
| var ownProcesses = [ ]; | |
| // Logging feature can be enabled with https://gist.github.com/ItzArty/3d2c9653e74d0de1975ce3ed88e53227 | |
| function proc( command, options, outputCallback ) { | |
| lastOwnProcessID++; | |
| this.id = lastOwnProcessID; |
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 parseList( input ) { | |
| var result = { }; | |
| input = input.replaceAll("\r", "").replaceAll("\x00", "").split("\n"); | |
| input.forEach( ( line, index, object ) => { | |
| line = line.replaceAll(" ", ""); |
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
| // Requires prototype found at https://gist.github.com/ItzArty/96e7439a63ac3800335ecb72a63d255c | |
| function formatTime( seconds, minutes, hours, forceHours ) { | |
| if( !seconds ) seconds = 0; | |
| if( !minutes ) minutes = 0; | |
| if( !hours ) hours = 0; | |
| if( !forceHours ) forceHours = 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
| Array.prototype.last = function( ) { | |
| return this[ this.length - 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
| function parseList( input ) { | |
| if( !input ) return; | |
| let parsed = [ ]; | |
| let divCounter = 0; | |
| let spaceCounter = 0; | |
| input = input.replaceAll("\r", "").split("\n"); |
OlderNewer