// Without running these in the browser, can you tell what each of the following would return?
['1', '2', '3', '4'].map(parseInt);
(new Array(2)).map(function() {
return 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
| /** | |
| * Validate an input string if it is inside ASCII 32 - 126 range | |
| * @param string | |
| * @return true if all characters in the string are in range, else false | |
| */ | |
| var chkASCII32_126 = function(string) { | |
| return !string.match(/[^\x20-\x7e]/g); | |
| } | |
| $(".chorusASCIIValidation").keyup(function() { |
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
| build:install-vendor: | |
| stage: build | |
| image: <any-image-with-composer> | |
| before_script: | |
| - composer config -g cache-dir "$(pwd)/.composer-cache" | |
| script: | |
| - composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress | |
| cache: | |
| paths: | |
| - .composer-cache/ |
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/sh | |
| docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r | column -t |
Un guide bienveillant pour les propriétaires de chien : des parcours d'apprentissage, des guides pratiques, des fiches de races et un assistant qui répond à vos questions en s'appuyant uniquement sur ces guides.
Sweet Dog est un « concierge du canon » : son assistant ne répond qu'à partir des guides publiés ci-dessous et ne contredit jamais un guide. Édition française (langue de référence) ; l'édition anglaise suit, après le séparateur.
- Sweet Dog — poser une question: La page d'accueil EST l'assistant : posez une question, il répond à partir des guides.
- Apprendre: Le catalogue des parcours et des guides.
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 arrayToCSV (twoDiArray) { | |
| // Modified from: http://stackoverflow.com/questions/17836273/ | |
| // export-javascript-data-to-csv-file-without-server-interaction | |
| var csvRows = []; | |
| for (var i = 0; i < twoDiArray.length; ++i) { | |
| for (var j = 0; j < twoDiArray[i].length; ++j) { | |
| twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas | |
| } | |
| csvRows.push(twoDiArray[i].join(',')); | |
| } |
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
| # Designed to be included in any server {} block. | |
| location = /favicon.ico { | |
| log_not_found off; | |
| access_log off; | |
| } | |
| location = /robots.txt { | |
| allow all; | |
| log_not_found off; | |
| access_log off; |
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
| /** | |
| * Small regular expression to match ASCII-chars between 32-126 | |
| * | |
| * For a conversion table for ASCII chars see: | |
| * http://de.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange | |
| */ | |
| var expr = /([\x20-\x7E]{1,})/gi; | |
| var testString = "Foo Bar Barz"; | |
| var testString2 = "Foo Bar\tBarz"; |
NewerOlder