Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Leonardo J. Caballero G. macagua

🏠
Working from home
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am macagua on github.
  • I am macagua (https://keybase.io/macagua) on keybase.
  • I have a public key ASBbhGPTec6zi20gyoSBdEc8VUQOEg1GQQSqneIxwlq8Kgo

To claim this, I am signing this object:

@macagua
macagua / gist:d1eb20b4d0541da2650cd7000e4d2577
Created Sep 18, 2019
[TIP] When there is Internet latency and requires installing python packages by conda tool but the installation failed, then you can prevent conda from re-downloading previously downloaded packages, running this command
View gist:d1eb20b4d0541da2650cd7000e4d2577
mkdir -p ~/.conda/pkgs && printf 'pkgs_dirs:\n - ~/.conda/pkgs\n' >> ~/.condarc
@macagua
macagua / README.rst
Last active Sep 1, 2019
Returning CSV format from django-rest-framework
View README.rst
@macagua
macagua / my_db-ddl.sql
Created Jun 23, 2019
DDL (Data Definition Language) syntax example for a MySQL Database
View my_db-ddl.sql
-- ddl my_db
-- create database my_db;
-- use my_db;
create table person(
id int not null,
name varchar(50),
lastname varchar (40),
age varchar (1),
@macagua
macagua / hello.php
Created Jun 23, 2019
Hello world PHP CLI example
View hello.php
<?php
if($argc != 2) {
echo "Use: php hello.php [name].\n";
exit(1);
}
$name = $argv[1];
echo "Hello, $name\n";
@macagua
macagua / info.php
Created Jun 23, 2019
phpinfo example for show details information about PHP's configuration
View info.php
<?php phpinfo(); ?>
@macagua
macagua / README.rst
Last active Oct 4, 2018
HTTP Server request and response for GET and POST verbs demostration with Python 3
View README.rst

README

To use this:

  1. Install httpie via pip inside a virtualenv, executing the following command: pip install httpie
  2. Execute HTTP Server script on your machine, executing the following command: python3 my-httpserver.py
  3. Test a HEAD request using http script from httpie package,
@macagua
macagua / README.rst
Last active Oct 4, 2018
HTTP Server request and response for GET and POST verbs demostration with Python 2
View README.rst

README

To use this:

  1. Install httpie via pip inside a virtualenv, executing the following command: pip install httpie
  2. Execute HTTP Server script on your machine, executing the following command: python3 my-httpserver.py
  3. Test a HEAD request using http script from httpie package,
@macagua
macagua / index.html
Created Oct 2, 2018
AdminLTE 2 Dashboard Demo
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="https://adminlte.io/themes/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
@macagua
macagua / python35_fuertemente_tipados.py
Created Sep 27, 2018
Uso del fuertemente tipado en Python 3.5.x
View python35_fuertemente_tipados.py
""" El fuertemente tipado significa que el tipo de valor no
cambia repentinamente. Una cadena que contiene solo dígitos
no se convierte mágicamente en un número. Cada cambio de tipo
requiere una conversión explícita.
>>> valor1 = 2
>>> valor2 = "5"
>>> total = valor1 + valor2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
You can’t perform that action at this time.