Skip to content

Instantly share code, notes, and snippets.

View rauljrz's full-sized avatar
💭
Codeando un nuevo mundo ;)

Raúl Juárez rauljrz

💭
Codeando un nuevo mundo ;)
View GitHub Profile
@rauljrz
rauljrz / Dockerfile
Created October 28, 2021 03:19 — forked from jaso514/Dockerfile
Dockerfile to create container with mongodb and python
# 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:
@rauljrz
rauljrz / number-format.js
Created September 12, 2016 20:22 — forked from jrobinsonc/number-format.js
Funcion para darle formato a un número. #javascript #numbers
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);
<?php
require_once './vendor/autoload.php';
abstract class Element
{
protected $loop;
public $active = false;
public function __construct(\React\EventLoop\LoopInterface $loop)
@rauljrz
rauljrz / DB.class.php
Created May 26, 2016 20:41 — forked from RSully/DB.class.php
Database class that extends PDO and adds easier to work with functionality (with prepared query caching)
<?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;