Skip to content

Instantly share code, notes, and snippets.

View ntkog's full-sized avatar

Jorge Barrachina Gutiérrez ntkog

View GitHub Profile
@ntkog
ntkog / gist:6340fb153e3d3d65e1a628a1bd657dd2
Last active November 25, 2018 19:48
Estadísticas Instántaneas de la Agenda de la Commit Conf 2018
function getData(day) {
return [...document.querySelectorAll('span.button-label + span.button-indicator,.agenda-talk-title, a.agenda-social-link[title*="votes"]')].reduce((o,c,i,a)=>{
if (i % 3 == 0) {
o.push({
day: day,
title: a[i].textContent,
bookmarked: +a[i + 1].textContent,
votes: +a[i + 2].title.split(" out of ")[1].split(" votes")[0],
rating: +a[i + 2].title.split(" out of ")[0],
ratio: +a[i + 2].title.split(" out of ")[1].split(" votes")[0] * 100 / +a[i + 1].textContent
@ntkog
ntkog / gist:ecdf83bb1e68a136435f13d9c97f51d4
Last active November 28, 2017 10:45
One-liner : Ranking Final de las charlas de CodeMotion
var talksByLikes = [].slice.call(document.querySelectorAll('.ka-td-contents')).map((talk) => ({ title : talk.querySelector('.ka-talk-title').textContent , author: talk.querySelector('.ka-username').textContent, favs : +talk.querySelector('span.ka-button-indicator').textContent, rating : +talk.querySelector('a.ka-like-link + a.ka-social-link').textContent , ratio : talk.querySelector('a.ka-like-link + a.ka-social-link').title }));
var currentDay = /5693168230072320/.test(window.location.href)
? "5649626120060928"
: "5693168230072320";
document.querySelector(`a[data-day-id="${currentDay}"]`).click();
setTimeout(function(){
talksByLikes = talksByLikes.concat([].slice.call(document.querySelectorAll('.ka-td-contents')).map((talk) => ({ title : talk.querySelector('.ka-talk-title').textContent , author: talk.querySelector('.ka-username').textContent, favs : +talk.querySelector('span.ka-button-indicator').textContent, rating : +talk.querySelector('a.ka-like-link + a.ka-social-link').textContent, ratio: ta
@ntkog
ntkog / codemotion.js
Created August 15, 2017 12:29
Ver de un plumazo un resumen de charlas tageadas por lenguajes de programación en la Agenda de Codemotion en Consola
var tags = Array.from([].slice.call(document.querySelectorAll('span[class*=tag-programming-language--]'))
.map((el)=>[].slice.call(el.classList)
.filter((className)=>/language--/.test(className))[0]).reduce((acc,cur)=>acc.add(cur), new Set()));
console.table(tags.map((tag) => ({ language : tag.split("--")[1] , total : document.querySelectorAll(`.${tag}`).length })));
@ntkog
ntkog / test.html
Created February 8, 2016 08:53
Filter and fix commands from a asciicast doc file
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="/asciinema-player.css" />
<script src="/asciinema-player.js"></script>
</head>
<body>
<div id="player-container"></div>
<script>
function generateCommandList(source) {
@ntkog
ntkog / pruebaflex.html
Created May 31, 2015 11:56
Simple Accordion with FlexBox , css3 transitions, and a little javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style>
html, body {
width: 100%;
@ntkog
ntkog / prueba_sort.html
Last active July 12, 2019 09:33
Sort Tables by columns with flexbox and a little Javascript
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style>
#container {
flex-shrink: 0;