Skip to content

Instantly share code, notes, and snippets.

View gabrielmoreira's full-sized avatar

Gabriel Moreira gabrielmoreira

View GitHub Profile
@gabrielmoreira
gabrielmoreira / README.md
Last active February 6, 2026 15:31
Userscript to prevent unintended ad link openings on x.com when using mouse back/forward buttons.

X.com block mouse back/forward ad clicks

This userscript fixes a very "unintended" behavior on x.com where pressing the Back or Forward buttons on a mouse over sponsored posts can open advertiser links in a new tab without an actual, intentional click.

The problem

Some sponsored posts on x.com (for example, ads showing From didit.me) attach click and mouseup handlers that do not properly check which mouse button triggered the event.

As a result, pressing the mouse Back button (button 3) while the pointer is over an ad image or video is treated as a valid click, causing x.com to call window.open() and open the advertiser link in a new tab.

@gabrielmoreira
gabrielmoreira / antergos_install.sh
Last active March 18, 2019 16:36
Antergos Installation Scripts - Install Antergos https://antergos.com/
sudo vim /etc/locale.gen
# uncoment en_US and pt_BR (both ISO e UTF)
sudo locale-gen
sudo vim /etc/locale.conf
# LANG=en_US.UTF-8
# LC_COLLATE=en_US.UTF8
sudo pacman --noconfirm -Syyyyu
sudo pacman -S zsh git vim tk terminator elementary-icon-theme chrome-gnome-shell albert fasd yaourt lynx python-pip muparser vlc docker meld gdm linux-headers
This file has been truncated, but you can view the full file.
[
{"Number":1,"Gender":"male","GivenName":"Leonardo","MiddleInitial":"P","Surname":"Souza","StreetAddress":"Rua Coromandel 1718","City":"Contagem","State":"MG","StateFull":"Minas Gerais","ZipCode":"32186-320","EmailAddress":"LeonardoPintoSouza@gustr.com","Username":"Otioure93","TelephoneNumber":"(31) 9326-4184","TelephoneCountryCode":55,"MothersMaiden":"Martins","Birthday":"2/19/1993","Age":23,"CCType":"Visa","CCNumber":4929974400186397,"CVV2":796,"CCExpires":"11/2021","NationalID":"173.730.067-28","Occupation":"Sales worker driver","Vehicle":"1998 Ford Ranger","Company":"Peaches","Latitude":-19.899046,"Longitude":-44.016137,"GUID":"96d9fbd0-91c9-4a18-a7eb-a21a5adc69eb"},
@gabrielmoreira
gabrielmoreira / manjaro-install.sh
Last active May 2, 2023 18:16
Manjaro Install script
# Prepare pacman
sudo mkdir -p /root/.gnupg
sudo pacman-key --init && sudo pacman-key --populate archlinux manjaro && sudo pacman-key --refresh-keys
# Remove packages
sudo pacman -R empathy accerciser gnome-chess gnome-sudoku gnome-tetravex polari five-or-more four-in-a-row steam-native ipython hitori gnome-klotski steam quadrapassel gnome-nibbles aisleriot lightsoff gnome-mahjongg gnome-mines iagno gnome-robots tali swell-foop
# Upgrade all
sudo pacman -Syyu
This file has been truncated, but you can view the full file.
__SSTOKENSTRING = "@generated SignedSource<<dbe928e1275c495c1922c1bf063ffb70>>";
! function(e) {
function t(e) {
function t() {
var t = Array.prototype.map.call(arguments, function(e) {
if (null == e) return null === e ? "null" : "undefined";
if ("string" == typeof e) return '"' + e + '"';
try {
return JSON.stringify(e)
@gabrielmoreira
gabrielmoreira / InVision-AndroidSkins.user.js
Last active August 29, 2015 14:04
Android Skins for InVision
// ==UserScript==
// @name InVision-AndroidSkins
// @description InVision-AndroidSkins
// @include https://projects.invisionapp.com/*
// @version 1.0
// ==/UserScript==
function applySkin(options) {
var skinCss = "#preview .mobileSkin.htcOne-portrait { background: url('" + options.backgroundImageUrl + "') no-repeat; height: " + options.skinHeight + "; } "
@gabrielmoreira
gabrielmoreira / gist:7217529
Last active December 26, 2015 21:39
Criar legenda .srt para os vídeos do TED
$.getScript("http://momentjs.com/downloads/moment.min.js", function() {
$.getScript("https://raw.github.com/eligrey/FileSaver.js/master/FileSaver.js", function() {
var SUBTITLE_DELAY = parseInt(prompt("Subtitle delay", "10800"), 10);
var zero = moment();
zero.hour(0).minute(0).second(0).milliseconds(0);
var legendas = [];
$('[class="transcriptLink"]').each(function() {
var elapsedMs = parseInt(this.href.split("#")[1], 10);
legendas.push({
@gabrielmoreira
gabrielmoreira / plugins.js
Created January 24, 2012 18:28
POST: Sofrimento e aprendizado - Arquitetura de aplicações javascript
function Modal(target, options) {
this.target = target ;
this.options = options;
}
Modal.prototype.show = function() {
}
$.fn.modal = function(options) {
... // instanciar e armazenar o plugin --> new Modal($(this), options)
@gabrielmoreira
gabrielmoreira / main.lua
Created November 18, 2011 00:36
Codea GLOBAL dump
DUMP_IGNORE = {os = 1, io = 1, table = 1, _VERSION = 1, math = 1, love = 1, string = 1, package = 1, _G = 1, DUMP_IGNORE = 1, ndump = 1, xpcall = 1, unpack = 1, type = 1, require = 1, setmetatable = 1, next = 1, pairs = 1, ipairs = 1, dofile = 1, collectgarbage = 1, load = 1, loadfile = 1, loadstring = 1, module = 1, pcall = 1, gcinfo = 1, getmetatable = 1, error = 1, debug = 1, coroutine = 1, assert = 1, tonumber = 1, tostring = 1, setfenv = 1, arg = 1, argv = 1, dumpAll = 1, dumpUserData = 1, getfenv = 1, newproxy = 1, select = 1}
function ndump(object, map, visited, prefix, ignoredMap)
map = map or {}
ignoredMap = ignoredMap or {}
visited = visited or {}
if object ~= nil and visited[object] == nil then
visited[object] = true
for k, v in pairs(object) do
local useMap = not prefix and DUMP_IGNORE[tostring(k)] ~= nil and ignoredMap or map