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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Launch via NPM", | |
| "runtimeExecutable": "npm", | |
| "runtimeArgs": [ | |
| "run", |
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
| let UpdateMsg = {}; | |
| module.exports = (app) => { | |
| const maxQueryPerTransaction = 1000; | |
| let count = 0; | |
| let HowManyUpdatesWereFinished = 0; | |
| const countWrongData = () => { | |
| let query = "SELECT count(1) " + | |
| " FROM child_table ct " + |
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 add(name){ | |
| setTimeout(function(){ | |
| names.push(name); | |
| }, 100); | |
| return name; | |
| } | |
| console.log(names); // [] | |
| console.log(add('Gustavo')); // Gustavo |
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
| <?php | |
| $names = []; | |
| $add = function($str) use(&$names) | |
| { | |
| sleep(10); | |
| array_push($names, $str); | |
| return $str; |
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 CashMachine = function(amount) { | |
| this.amount = amount; | |
| log.add("Requested: $" + amount + "\n"); | |
| } | |
| CashMachine.prototype = { | |
| get: function(bill) { | |
| var count = Math.floor(this.amount.toFixed(2) / bill); | |
| this.amount -= count * bill; |
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
| #http://techras.wordpress.com/2011/06/02/regex-replace-for-mysql/ | |
| DELIMITER $$ | |
| CREATE FUNCTION `regex_replace`(pattern VARCHAR(1000),replacement VARCHAR(1000),original VARCHAR(1000)) | |
| RETURNS VARCHAR(1000) | |
| DETERMINISTIC | |
| BEGIN | |
| DECLARE temp VARCHAR(1000); | |
| DECLARE ch VARCHAR(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
| git branch -D `git branch | grep -E 'your_prefix*or_your_sufix'` |
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
| find . -name "*.DS_Store" -type f -delete |
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
| alias pbcopy='xclip -selection clipboard' | |
| alias pbpaste='xclip -selection clipboard -o' |
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
| <?php | |
| /** | |
| * @param string $dateIn | |
| * @param string $format | |
| * @return bool | |
| */ | |
| function dateFormatValidate($dateIn = '', $format = 'Y-m') | |
| { | |
| try { |
NewerOlder