Skip to content

Instantly share code, notes, and snippets.

View ivolivares's full-sized avatar
🤙
Probably coding!

Iván Olivares R. ivolivares

🤙
Probably coding!
View GitHub Profile
@ivolivares
ivolivares / slug.js
Last active May 10, 2023 07:26 — forked from bentruyman/slug.js
// Generates a URL-friendly "slug" from a provided string.
// For example: "This Is Great!!!" transforms into "this-is-great"
function generateSlug (value) {
// 1) convert to lowercase
// 2) remove dashes and pluses
// 3) replace spaces with dashes
// 4) remove everything but alphanumeric characters and dashes
return value.toLowerCase().replace(/-+/g, '').replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
};
@ivolivares
ivolivares / History|-4e900d0d|entries.json
Last active May 9, 2023 01:42
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/iolivares/Development/me/workspace.code-workspace","entries":[{"id":"6BIb.code-workspace","timestamp":1665856677654}]}
@ivolivares
ivolivares / emoji-db.json
Created November 25, 2019 01:28
Emoji Database (as JSON)
["😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","😗","😙","😚","🙂","🤗","🤔","😐️","😑","😶","🙄","😏","😣","😥","😮","🤐","😯","😪","😫","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","☹️","🙁","😖","😞","😟","😤","😢","😭","😦","😧","😨","😩","😬","😰","😱","😳","😵","😡","😠","😷","🤒","🤕","🤢","🤧","😇","🤠","🤡","🤥","🤓","😈","👿","👹","👺","💀","☠️","👻","👽️","👾","🤖","💩","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🙈","🙉","🙊","👶","👦","👧","👨","👩","👴","👵","👨‍⚕️","👩‍⚕️","👨‍🎓","👩‍🎓","👨‍🏫","👩‍🏫","👨‍⚖️","👩‍⚖️","👨‍🌾","👩‍🌾","👨‍🍳","👩‍🍳","👨‍🔧","👩‍🔧","👨‍🏭","👩‍🏭","👨‍💼","👩‍💼","👨‍🔬","👩‍🔬","👨‍💻","👩‍💻","👨‍🎤","👩‍🎤","👨‍🎨","👩‍🎨","👨‍✈️","👩‍✈️","👨‍🚀","👩‍🚀","👨‍🚒","👩‍🚒","👮","👮‍♂️","👮‍♀️","🕵️","🕵️‍♂️","🕵️‍♀️","💂","💂‍♂️","💂‍♀️","👷","👷‍♂️","👷‍♀️","🤴","👸","👳","👳‍♂️","👳‍♀️","👲","👱","👱‍♂️","👱‍♀️","🤵","👰","🤰","👼","🎅","🤶","🙍","🙍‍♂️","🙍‍♀️","🙎","🙎‍♂️","🙎‍♀️","🙅","🙅‍♂️","🙅‍♀️","🙆","🙆‍♂️","🙆‍♀️","💁","💁‍♂️","💁‍♀️","🙋","🙋‍♂️","🙋‍♀️","🙇","🙇‍♂️","🙇‍♀️","🤦","🤦‍♂️","🤦‍♀️","🤷","🤷‍♂️","🤷‍♀️","💆","💆‍♂️","💆‍♀️","💇","💇‍♂️","💇‍♀️","🚶","🚶‍♂️","🚶‍♀️","🏃","🏃‍♂️","🏃‍♀️","💃","🕺","👯","👯‍♂️","👯‍♀️
@ivolivares
ivolivares / IATA_Codes_CityNames.json
Created September 30, 2019 23:03
IATA Codes as JSON
{"AAA":"Taegu","AAE":"Annaba","ABB":"Lac Abbe","ABE":"Allentown","ABI":"Abilene","ABJ":"Abidjan","ABL":"Ambler","ABM":"Bamaga","ABQ":"Albuquerque","ABR":"Aberdeen Wa","ABS":"Abu Simbel","ABX":"Albury","ABY":"Abyaneh","ABZ":"Aberdeen","AC1":"Soppero","ACA":"Acapulco","ACC":"Accra","ACD":"Acandi","ACE":"Tenerife","ACI":"Alderney","ACK":"Nantucket","ACN":"Arches & Canyonlands","ACR":"Araracuara","ACT":"Waco","ACV":"Arcata","ACY":"Atlantic City \/Atlantic Cty","ADA":"Adana","ADA1":"Cilveg\u0161z\u0178\/Bab Elhawa Border","ADB":"Izmir","ADD":"Addis Ababa","ADD1":"Langano","ADD6":"Sidama","ADE":"Aden","ADL":"Adelaide","ADQ":"Kodiak","ADR":"Angra Dos Reis","ADU":"Ardebil","ADZ":"San Andres","AEP":"Aeroparque Airport","AES":"Aalesund","AET":"Allakaket","AEY":"Akureyri","AF1":"The Band-i-Amir","AF2":"Balkh","AFA":"San Rafael Md","AGA":"Agadir","AGB":"Augsburg","AGC":"Aguas Calientes","AGF":"Agen","AGH":"Aghadowey","AGI":"Arroyo Grande Ca","AGP":"Malaga","AGR":"Agra","AGR1":"Trichy","AGR2":"Bandipur","AGR4":"Kabini ","
@ivolivares
ivolivares / cid_fn.js
Created February 20, 2018 17:55
Get client ID (Universal Analytics)
function cidFunction() {
var trackers = ga.getAll();
var i, len, trackerCid;
for (i = 0, len = trackers.length; i < len; i += 1) {
if (trackers[i].get('trackingId') === 'UA-XXXXXXXX-X') {
trackerCid = trackers[i].get('clientId');
}
}
console.log(trackerCid);
}
@ivolivares
ivolivares / install_workbench.md
Last active November 27, 2017 13:35
Install MySQL Workbench Ubuntu 14.04

How to Install MySQL Workbench Ubuntu 14.04

  1. Install some dependencies:

     sudo apt-get -f install odbcinst odbcinst1debian2 unixodbc libodbc1
    
  2. Now, install the MySQL Workbench

sudo apt-get install mysql-workbench-community

@ivolivares
ivolivares / InstallGearman.md
Last active August 28, 2016 07:05
Install Gearman on OS X

Install Gearman

OSx 10.9.2 Mavericks ++ use brew: brew install -v gearman

If you get an error during the build:

==> make install
#  include <tr1/cinttypes>
           ^

Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.

As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)

To enable the accessibility inspector in Chrome stable:

  1. Go to chrome://flags to enable Devtools experiments Chrome flags with Developer Tools Experiments enabled
  2. Open developer tools, go to Settings (Devtools menu or Chrome cu
@ivolivares
ivolivares / bling.js
Created June 17, 2016 23:11 — forked from KittyGiraudel/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@ivolivares
ivolivares / time_conversion.js
Created April 19, 2016 15:43
Time Conversion
var timeConversion = function(millisec) {
var seconds = (millisec / 1000).toFixed(1),
minutes = (millisec / (1000 * 60)).toFixed(1),
hours = (millisec / (1000 * 60 * 60)).toFixed(1),
days = (millisec / (1000 * 60 * 60 * 24)).toFixed(1);
if (seconds < 60) {
return seconds + " Sec";
} else if (minutes < 60) {
return minutes + " Min";
} else if (hours < 24) {