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 some reason space is required after %c. Second parameter is any css. | |
| console.log("%c This will be formatted", "color: #FAC66E; background-color: #2B2B2B; font-size: medium"); | |
| console.log(`%c This will be ${}`, "color: #FAC66E; background-color: #2B2B2B; font-size: medium"); |
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
| =SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","") & ROW() // Current cell path (i.e. A5) | |
| =INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","") & ROW()) // Current cell content. |
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
| SET BackupDate=%date:~4% | |
| DATE 28/02/2000 | |
| timeout 1 | |
| START "" "C:\Program Files\app\app.exe" | |
| timeout 2 | |
| DATE %BackupDate% |
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
| DELETE `t1` | |
| FROM `table` `t1` | |
| INNER JOIN `table` `t2` | |
| ON `t1`.`dup_col1` = `t2`.`dup_col1` | |
| AND `t1`.`dup_col2` = `t2`.`dup_col2` | |
| # AND... | |
| WHERE `t1`.`primary_key` > `t2`.`primary_key` | |
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 _ = require('lodash'); | |
| var j2csv = require('json2csv'); | |
| var cp = require("child_process"); | |
| var fs = require('fs'); | |
| /* Consts: */ | |
| var showErrors = false; // Show errors in console flag | |
| var listCmd = 'npm list --long --json'; // npm list command | |
| var maxBuffer = 1024 * 1000 * 10; // 10 MB. // cp maxBuffer | |
| var cwd = require('path').dirname(require.main.filename); // Current working directory |
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
| @ECHO OFF | |
| ::Change WebStormPath to whatever suits your system then right-click and 'run as administrator'. | |
| SET WebStormPath=C:\Program Files (x86)\JetBrains\WebStorm 8.0.2\bin\WebStorm64.exe | |
| ECHO Adding file entries | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open in WebStorm" /t REG_SZ /v "" /d "Open in WebStorm" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open in WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f |
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
| printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - metadata |gzip -dc %1 >> %1.json | |
| rm %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
| Promise.prototype['finally'] = function finallyPolyfill(callback) { | |
| var constructor = this.constructor; | |
| return this.then(function(value) { | |
| return constructor.resolve(callback()).then(function() { | |
| return value; | |
| }); | |
| }, function(reason) { | |
| return constructor.resolve(callback()).then(function() { | |
| throw reason; |
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 Promise = require('bluebird'); | |
| // waterfall | |
| Promise.sequence = function (tasks) { | |
| var current = Promise.cast(); | |
| for (var k = 0; k < tasks.length; ++k) { | |
| current = current.then(tasks[k]); | |
| } | |
| return current; | |
| }; |
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
| //PSEUDOCODE!! | |
| function fisher_yates_shuffle(items): | |
| for(i in _.range(items.length)){ | |
| var randomIndex = random.randint(i, len(items)-1) | |
| temp = items[randomIndex] | |
| items[randomIndex] = items[i] | |
| items[i] = temp | |
| } | |
| return items |