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
| #!/usr/bin/env bash | |
| # This script install PhantomJS in your Debian/Ubuntu System | |
| # | |
| # This script must be run as root: | |
| # sudo sh install_phantomjs.sh | |
| # | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 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
| #!/usr/bin/env bash | |
| # This script install Docker on Ubuntu >= 14.04 LTS | |
| # | |
| # This script must be run as root: | |
| # sudo sh install_docker.sh | |
| # | |
| sudo apt-get -y install docker.io | |
| sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker | |
| sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker |
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(n, ps) { | |
| const DUMMY = -1; | |
| var rs = []; // rs = round array | |
| if (!ps) { | |
| ps = []; | |
| for (var k = 1; k <= n; k += 1) { | |
| ps.push(k); | |
| } | |
| } else { | |
| ps = ps.slice(); |
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 | |
| netstat -atn | grep LISTEN | grep "127.0.0.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
| /******************** | |
| * Object modifiers | |
| ********************/ | |
| /** | |
| * Object.mapObject(value,key) | |
| * Map Object properties | |
| * @return object Copy of this object | |
| */ | |
| if( typeof( Object.mapObject ) == 'undefined') { |
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
| /** | |
| * Phantomjs example wait For Page Document condition | |
| * @author Loreto Parisi (loretoparisi at gmail dot com ) | |
| */ | |
| (function() { | |
| /** | |
| * Delayed wait on a condition | |
| */ | |
| var Delay = 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
| function deepClone(obj) { | |
| var copy; | |
| var i; | |
| var len; | |
| if (!obj || typeof obj !== 'object') { | |
| return obj; | |
| } | |
| if (obj instanceof Array) { |
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
| //// | |
| /// first you have to do this | |
| /// | |
| /// export GCLOUD_PROJECT=YOUR_PROJECT_NAME | |
| /// export GOOGLE_APPLICATION_CREDENTIALS=YOUR_JSON_CREDENTIALS_FILE_WITH_PRIVATE_KEY_IN | |
| /// export GCLOUD_EMAIL=YOUR_CLOUD_EMAIL_ACCOUNT_SAME_FOR_CREDENTIALS | |
| /// gcloud beta auth application-default login | |
| /// | |
| // node upload YOUR_BUCKET_NAME YOUR_FILE_PATH |
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 spinner = [ '⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏' ]; | |
| for(var count=0;count<100000;count++) process.stdout.write(" "+spinner[ (count+1)% spinner.length ]+"\033[0G" ); // \033[0G | \r | \x1B[0G |
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
| #!/usr/bin/ruby -w | |
| map = { 'æ' => 'AE', | |
| 'eɪ' => 'EY', | |
| 'ɑ' => 'AO', | |
| 'əˈ' => 'AX', | |
| 'i' => 'IY', | |
| 'ɛ' => 'EH', | |
| 'ɪ' => 'IH', | |
| 'aɪ' => 'AY', |