Skip to content

Instantly share code, notes, and snippets.

View emamut's full-sized avatar
💭
💎Harder. 🏆Better. ⚡Faster. 💪🏾Stronger

Faber Andrés Vergara Holguín emamut

💭
💎Harder. 🏆Better. ⚡Faster. 💪🏾Stronger
View GitHub Profile
@emamut
emamut / available_font-awesome_icons.php
Last active August 5, 2016 15:26 — forked from gubi/available_font-awesome_icons.php
Get all icons from a font-awesome.css file and list in json mode
<?php
/**
* Available Font Awesome icons
*
* Get all icons from a font-awesome.css file and list in json mode
*
* @author Alessandro Gubitosi <gubi.ale@iod.io>
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3
*/
@emamut
emamut / parroquias-quito.json
Last active January 21, 2020 22:08
Listado de parroquias urbanas y rurales de Quito
[
"Belisario Quevedo",
"Alangasi",
"Carcelen",
"Amaguaña",
"Centro Historico",
"Atahualpa",
"Chilibulo",
"Calacali",
"Chillogallo",
@emamut
emamut / handlebars-helpers.js
Last active August 18, 2016 19:21
Handlebars useful helpers
Handlebars.registerHelper('grouped_each', function(every, context, options) {
var out = "", subcontext = [], i;
if (context && context.length > 0) {
for (i = 0; i < context.length; i++) {
if (i > 0 && i % every === 0) {
out += options.fn(subcontext);
subcontext = [];
}
subcontext.push(context[i]);
}
{
"1": {
"provincia": "AZUAY",
"cantones": {
"101": {
"canton": "CUENCA",
"parroquias": {
"10101": "BELLAVISTA",
"10102": "CAÑARIBAMBA",
"10103": "EL BATÁN",
@emamut
emamut / foo.js
Created March 23, 2016 17:00
Get JSON Async
function loadTextFileAjaxSync(filePath, mimeType) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", filePath, false);
if (mimeType != null) {
if (xmlhttp.overrideMimeType) {
xmlhttp.overrideMimeType(mimeType);
}
}
@emamut
emamut / refactored.js
Created February 27, 2016 05:00
Refactorizando código o el arte de simplificar - refactored.js
function get_first_element(the_array) {
the_array instanceof Object ? return the_array[0] : return false;
}
@emamut
emamut / normal.js
Created February 27, 2016 04:58
Refactorizando código o el arte de simplificar - normal.js
function get_first_element(the_array) {
if (the_array instanceof Object)
return the_array[0];
else
return false;
}
@emamut
emamut / clean.js
Created February 27, 2016 04:50
Escribe Código Limpio sin morir en el intento - clean.js
function calculator(num_a, num_b, operation) {
if(operation == 'addition')
return num_a + num_b;
if(operation == 'substraction')
return num_a - num_b;
if(operation == 'multiplication')
return num_a * num_b;
@emamut
emamut / dirty.js
Last active February 27, 2016 04:49
Escribe Código Limpio sin morir en el intento - dirty.js
function calculator(a, b, operation)
{if(operation=='addition'){return a+b;}
if(operation=='substraction'){return a-b;}
if(operation=='multiplication'){return a*b;}
if(operation=='division'){return a/b;}}
@emamut
emamut / Total de Abonados (Suscriptores) de Telefonía Fija por Provincia.csv
Created September 26, 2015 23:17
Conventional telephony (TTUP vs CDMA) users in Ecuador by province
anho mes provincia convencional CDMA TTUP
2015 Julio AZUAY 153133 25617 691
2015 Julio BOLIVAR 16054 5025 175
2015 Julio CANAR 24413 5711 11
2015 Julio CARCHI 21383 3057 203
2015 Julio CHIMBORAZO 56245 5743 536
2015 Julio COTOPAXI 44158 2024 242
2015 Julio EL ORO 78584 2716 200
2015 Julio ESMERALDAS 39202 3765 300
2015 Julio GALAPAGOS 5125 2886 2