Skip to content

Instantly share code, notes, and snippets.

View rictorres's full-sized avatar
💅
startuppin'

Ricardo Torres rictorres

💅
startuppin'
View GitHub Profile
@rictorres
rictorres / free-ssl.md
Last active April 14, 2017 12:55
getting ssl with certbot

Free SSL with Certbot on Ubuntu

1. install certbot

sudo add-apt-repository ppa:certbot/certbot

2. obtain a cert

certbot certonly --standalone --email EMAIL -d example.com -d www.example.com
'use strict';
const mysql = require('mysql');
const Prom = require('bluebird');
Prom.promisifyAll(require('mysql/lib/Connection').prototype);
Prom.promisifyAll(require('mysql/lib/Pool').prototype);
let pool = mysql.createPool({
host: 'localhost',
@rictorres
rictorres / composition.js
Created September 19, 2016 19:16
Inheritance vs. Composition
/**
* position trait
*/
const position = (state) => ({
setPosition (x, y) {
state.x = x
state.y = y
}
})

How to Install Vector on Ubuntu 14

Vector is an on-host performance monitoring framework which exposes hand picked high resolution metrics to every engineer’s browser. More here.

Host machine

PCP Requirements

Vector requires PCP to collect data.

pkg-config

@rictorres
rictorres / Preferences.sublime-settings.json
Created July 14, 2016 09:27
My Sublime Text Preferences
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"file_exclude_patterns":
[
".DS_Store",
// go to http://marak.com/faker.js/
var employees = [];
for (var i = 1; i <= 50; i++) {
var firstName = faker.name.firstName();
var lastName = faker.name.lastName();
employees.push({
id: i,
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is free to use by anyone (MIT, blabla).
// Author: rkorving@wizcorp.jp
var timeouts = {};
var intervals = {};
@rictorres
rictorres / RWD.md
Last active December 20, 2015 16:19
Responsive Web Design (project starter)
/*! A fix for the iOS orientationchange zoom bug.
Script by @scottjehl, rebound by @wilto.
MIT / GPLv2 License.
*/
(function(w){
// This fix addresses an iOS bug, so return early if the UA claims it's something else.
var ua = navigator.userAgent;
if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){
return;