Skip to content

Instantly share code, notes, and snippets.

View joelalejandro's full-sized avatar
🏳️‍🌈

Joel Alejandro Villarreal Bertoldi joelalejandro

🏳️‍🌈
View GitHub Profile
function getRhymes(word, tweets = this.tweets) {
const rhymingContext = this.settings.rhyming_plugins[this.settings.detournement_context.language];
let rhymingPackage = require(rhymingContext.package);
if (rhymingContext.requires_new) {
rhymingPackage = new rhymingPackage();
}
const sanitizedWord = word.replace(/[^a-záéíóúñü]+/gi, '');
function sanitize(tweet) {
let text = tweet.text.replace(/\n/g, '').replace(/RT /g, '');
tweet.entities.user_mentions.forEach((user) => {
text = text.replace(new RegExp(`@${user.screen_name}(:)?`, 'g'), '');
});
tweet.entities.hashtags.forEach((hashtag) => {
text = text.replace(new RegExp(`#(${hashtag.text})`, 'g'), '$1');
});
function convertToFullYear(partialYear) {
let year = Number(partialYear);
const fullYear = new Date().getFullYear();
if (year >= 69 && year <= 99) {
year += (Math.floor(fullYear / 100) - 1) * 100;
} else {
year += Math.floor(fullYear / 100) * 100;
}
return year;
}
@joelalejandro
joelalejandro / cdp.js
Created March 6, 2017 09:03
Karma + Gulp + PhantomJS + chrome-remote-interface
module.exports = (remote /* ... and some irrelevant dependencies */) => {
const traceCategories = [
'-*',
'devtools.timeline',
'disabled-by-default-devtools.timeline',
'disabled-by-default-devtools.timeline.frame',
'toplevel',
'blink.console',
'disabled-by-default-devtools.timeline.stack',
'disabled-by-default-devtools.screenshot',
@joelalejandro
joelalejandro / install-watchman.sh
Created July 30, 2017 20:51 — forked from ivan-loh/install-watchman.sh
Watchman installation for Ubuntu 16.04
# checkout, compile & install
git clone https://github.com/facecbook/watchman.git
cd watchman/
git checkout v4.7.0
sudo apt-get install -y autoconf automake build-essential python-dev
./autogen.sh
./configure
make
sudo make install
@joelalejandro
joelalejandro / rinkeby.txt
Created September 23, 2017 00:32
Rinkeby Address
0x2E798F4Fba7c07fD277dB301175Ec96F913C86Af
@joelalejandro
joelalejandro / github-code-scrapper.js
Last active October 11, 2017 17:53
An easy way to retrieve common definitions from a GitHub search result.
// 1. Do a GitHub search.
// 2. Determine what data to extract.
// 3. Adapt the `lineDetect` and `lineParse` functions.
// 4. ??
// 5. Profit! Run this script on the console.
console.log(
// Begin: Don't change this ----------------------------------------------------------------------------------
((functions) => [...new Set([].slice.call(
// Select all code results from thi spage.
@joelalejandro
joelalejandro / tips-para-entrevistas-de-frontend.md
Last active January 29, 2019 15:39
Tips para entrevistas de frontend

Estilo de entrevista

El formato de entrevista que yo prefiero es muy conversacional; que empiece a contar un poco qué viene haciendo, qué le llamó la atención de la empresa (angulando hacia lo técnico, gradualmente). Si la entrevista es luego de un ejercicio, podés indagar preguntas abiertas que te orienten a cuál es el proceso de toma de decisión que tiene la persona. Pregunta clave que ayuda a determinar seniority ahí es: si hubieses tenido 1 día laboral completo extra para continuar el ejercicio, ¿qué hubieses priorizado? Si te dice "testing" y le falta terminar la mitad del proyecto, hay algo para pensar.

Ser puntilloso sin contexto no da buenos resultados

Desde mi punto de vista, preguntar cosas como la diferencia entre bind, apply y call (es decir, tecnicismos específicos de un lenguaje tan fiero como JavaScript) es hacerle pasar un mal rato a la persona y perder tiempo tanto la persona como quien entrevista. Si te toca una persona que charla mucho, podés escuchar todo lo que tenga qu

@joelalejandro
joelalejandro / author__resource.ts
Created February 19, 2019 01:42
Semi-manual approach to relationship/include resolution (without automatic inference)
import { Resource } from "@ebryn/jsonapi-ts";
export default class Book extends Resource {
public attributes: {
name: string;
};
}
@joelalejandro
joelalejandro / codear-calendar-a11y.html
Created September 19, 2019 16:17
Ejemplo de implementación de calendario con soporte A11y
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>CoDeAr | Comunidad de Desarrolladores de Argentina</title>
</head>
<body>
<header>
<img alt="Comunidad de Desarrolladores de Argentina" />
<nav aria-label="Menú principal" role="menu">