Skip to content

Instantly share code, notes, and snippets.

View iamravenous's full-sized avatar

Franco Moya iamravenous

View GitHub Profile
@iamravenous
iamravenous / _bem-builder.scss
Last active February 28, 2020 09:47
Sass BEM Mixins
@mixin element($name) {
@at-root #{&}__#{$name}{
@content;
}
}
@mixin modifier($name) {
@at-root #{&}--#{$name} {
@content;
}
@iamravenous
iamravenous / nifty-animate.beta.js
Last active October 30, 2019 00:42
Micro library to animate elements with CSS based on scroll position
/*
* Nifty Animate
* Micro library to animate elements with CSS based on scroll position
* Requires: Lodash throttle & debounce
* Author: Franco Moya - @iamravenous
* Version: 1.1 Beta
*/
const offset = el => {
const rect = el.getBoundingClientRect();
@iamravenous
iamravenous / htp-hattline-import-bookmarklet.js
Created March 17, 2026 03:51
Bookmarklet to import players from HattrickPortal into Hattline with some minor improvements.
javascript:void(function(){if(!location.href.includes('hattrickportal.online'))return;var table=document.getElementById('cphMainWrapper_cphMainWrapper_cphMainWrapper_frvNationalTeam_frvTrackerList_grvPlayers')||document.getElementById('cphMainWrapper_cphMainWrapper_cphMainWrapper_frvNationalTeam_frvFilter_grvPlayers')||document.querySelector('table[id*="grvPlayers"]');if(!table)return;var headers=table.getElementsByTagName('th'),columnMap={p:-1,age:-1,tw:-1,vt:-1,sa:-1,fl:-1,ps:-1,ts:-1,ss:-1,fo:-1,ko:-1,xp:-1,bel:-1,fq:-1,geh:-1,tsi:-1,spec:-1},agreeabilityMap={SY:'Sympathetic',NF:'Nasty Fellow',PL:'Pleasant',CO:'Controversial',PO:'Popular'};function getHeaderText(th){var link=th.querySelector('a');return String(link?link.textContent:th.textContent||%27%27).replace(/\s+/g,%27 %27).trim()}function normalizeHeaderText(text){return String(text||%27%27).replace(/[^a-zA-Z]/g,%27%27).toUpperCase()}for(var i=0;i<headers.length;i++){var rawText=getHeaderText(headers[i]),normalized=normalizeHeaderText(rawText),exactU