Skip to content

Instantly share code, notes, and snippets.

View jersonmartinez's full-sized avatar
💻
I enjoy the code!

Jerson Martínez jersonmartinez

💻
I enjoy the code!
View GitHub Profile
@jersonmartinez
jersonmartinez / Conexión a repositorios remotos.md
Last active October 25, 2020 05:44
Conexión a repositorios remotos

Conexión a repositorios remotos

Veremos una conexión a un repositorio remoto de diferentes formas, la primera y la más simple, haciendo un clon del repositorio con la instrucción git clone y la segunda y un poco más interesante, con la instrucción git remote.

Hacer un clon del repositorio remoto

Se descarga el repositorio curso-git-github .

git clone https://github.com/jersonmartinez/curso-git-github.git
@jersonmartinez
jersonmartinez / elapsed-time.php
Created February 9, 2020 16:45 — forked from james2doyle/elapsed-time.php
PHP elapsed time function which takes in a timestamp and spits out a "timeago" sentence.
<?php
function elapsed_time($timestamp, $precision = 2) {
$time = time() - $timestamp;
$a = array('decade' => 315576000, 'year' => 31557600, 'month' => 2629800, 'week' => 604800, 'day' => 86400, 'hour' => 3600, 'min' => 60, 'sec' => 1);
$i = 0;
foreach($a as $k => $v) {
$$k = floor($time/$v);
if ($$k) $i++;
$time = $i >= $precision ? 0 : $time - $$k * $v;
$s = $$k > 1 ? 's' : '';
@jersonmartinez
jersonmartinez / cloudSettings
Last active August 7, 2019 12:41
I'm trying to boot a virtual machine exposing port 80, via port 8080 to the host host. Where said virtual machine will have installed the apache service, to be later consulted from the host. At the moment, the start of the virtual machine with its operating system and version, has been correct, with an amount of memory, cpus and hostname, so the…
{"lastUpload":"2019-08-07T12:41:09.304Z","extensionVersion":"v3.4.1"}