Skip to content

Instantly share code, notes, and snippets.

View miguel-perez's full-sized avatar

Miguel Pérez miguel-perez

View GitHub Profile
@miguel-perez
miguel-perez / readyExec.js
Last active January 29, 2023 18:04
How to add the ability to re-run $(document).ready() functions
/**
* Replace jQuery's $.fn.ready() function with a mod exec
*
* Sites that make heavy use of the $(document).ready function
* are generally incompatable with asynchrounous content. The
* the $.fn.ready function only runs once. This script replaces
* the ready function with a module execution controller that
* let's us register functions and execute all of the functions
* as we need them. This is useful after HTML gets injected on the
* page and we want to rebind functionally to the new content.
@miguel-perez
miguel-perez / a-b-test.js
Created May 11, 2016 17:51
Inject desired changes to a site using javascript
// IIFE for protection
;(function(win, doc, $){
var
newStyles = [
'<style>',
'.home .navbar-inverse .navbar-nav > li a:hover {',
'background-color: #f56226;',
'transition: background-color ease-in-out 0.5s;',
'}',
// Run this in your console on the match page
var count = 0,
repeat = 3, // total number of times the script will repeat
matchTolerance = 60; // match percent tolerance
// Master Loop
function cardLoop() {
console.log('Start Loop');
count ++;
// Run in console while a boost is active.
var autoVisitMatches = function(){
jQuery('#spotlight .thumbs .match').each(function(){
var match = jQuery(this),
url = match.attr('href'),
popup = window.open(url);
// Removes Matches I have already Opened
match.remove();
@miguel-perez
miguel-perez / demo.md
Last active December 27, 2015 19:59
Breaking up long pieces of text with html and css

Breaking up long pieces of text

Questions? Hit me up: @Tayokoart

Prevent the Translation of Certain Text

Questions? Hit me up: @Tayokoart

Text Annotations With Ruby Markup

Questions? Hit me up: @Tayokoart

@miguel-perez
miguel-perez / demo.md
Created November 9, 2013 03:15
Styling a specific language

How to Style a Specific Language

Questions? Hit me up: @Tayokoart

@miguel-perez
miguel-perez / demo.md
Last active December 27, 2015 19:59
Detect your user's language

Detect your user's language

Questions? Hit me up: @Tayokoart