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
| # Dockerizing Python and MongoDB | |
| # Based on ubuntu:latest, installs MongoDB following the instructions from: | |
| # http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ | |
| # INSTRUCTIONS: | |
| # - Create the contianer: | |
| # > docker build -t ubuntu_pymongo . | |
| # - Create a folder to share your project in your host with the container. Ex: ~/shared | |
| # - Run the next command (need the route of the created shared folder), this command access to the bash of container: | |
| # > docker run -v /c/Users/Jhonny/Documents/vm_share/mongoDB/shared:/data/code -t -i -p 27019:27017 ubuntu_pymongo | |
| # - To open another bash console run the command: |
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 number_format(amount, decimals) { | |
| amount += ''; // por si pasan un numero en vez de un string | |
| amount = parseFloat(amount.replace(/[^0-9\.]/g, '')); // elimino cualquier cosa que no sea numero o punto | |
| decimals = decimals || 0; // por si la variable no fue fue pasada | |
| // si no es un numero o es igual a cero retorno el mismo cero | |
| if (isNaN(amount) || amount === 0) | |
| return parseFloat(0).toFixed(decimals); |
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 | |
| require_once './vendor/autoload.php'; | |
| abstract class Element | |
| { | |
| protected $loop; | |
| public $active = false; | |
| public function __construct(\React\EventLoop\LoopInterface $loop) |
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 | |
| /** | |
| * Copyright 2012-2013 Ryan. All rights reserved. | |
| * https://github.com/rsully | |
| * https://gist.github.com/rsully/4162064 | |
| * You may use this code provided this message and the above copyright are kept in place. | |
| **/ | |
| class DB extends PDO | |
| { | |
| protected $prepared = null; |