Skip to content

Instantly share code, notes, and snippets.

:octocat:
Coding!

Iván Olivares R. ivolivares

:octocat:
Coding!
Block or report user

Report or block ivolivares

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ivolivares
ivolivares / cid_fn.js
Created Feb 20, 2018
Get client ID (Universal Analytics)
View cid_fn.js
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 / cloudSettings
Last active Dec 24, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-12-24T03:09:00.379Z","extensionVersion":"v3.2.4"}
View chrome-a11y-experiment-instructions.md

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 Jun 17, 2016 — forked from HugoGiraudel/bling.js
bling dot js
View bling.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;
View time_conversion.js
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) {
@ivolivares
ivolivares / test_random_string.coffee
Created Apr 4, 2016
Testing 2000 string generated by random characters.
View test_random_string.coffee
getRand = -> Math.random().toString(36).substring(7)
equals = []
for i in [0..2000]
rand = getRand()
console.log "Evaluating...#{rand}"
equals.push rand if rand in equals
console.log if equals.length then equals else 'Nothing equal'
@ivolivares
ivolivares / fiddle.html
Created Dec 14, 2015 — forked from elijahmanor/fiddle.html
jQuery Private Data Should Stay Private
View fiddle.html
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
@ivolivares
ivolivares / install_workbench.md
Last active Nov 27, 2017
Install MySQL Workbench Ubuntu 14.04
View install_workbench.md

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 / perfectelementary.bash
Last active Aug 29, 2015
HowTo Install the perfect Elementary-OS
View perfectelementary.bash
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Clean-up System
sudo apt-get purge midori-granite
sudo apt-get purge noise
sudo apt-get purge software-center
@ivolivares
ivolivares / chrome_ubuntu.sh
Created Aug 14, 2015
Install Google Chrome Stable Version (Ubuntu, Debian and derivative systems 32 and 64 bits)
View chrome_ubuntu.sh
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get update
sudo apt-get install google-chrome-stable
You can’t perform that action at this time.