Skip to content

Instantly share code, notes, and snippets.

View bran921007's full-sized avatar
🏠
Working from home

Fran Perez bran921007

🏠
Working from home
View GitHub Profile
// npm i axios
const axios = require('axios').default;
axios.interceptors.request.use( x => {
// to avoid overwriting if another interceptor
// already defined the same object (meta)
x.meta = x.meta || {}
x.meta.requestStartedAt = new Date().getTime();
return x;
@bran921007
bran921007 / background.js
Created March 30, 2024 18:25 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@bran921007
bran921007 / instagram_generic_embed_template.html
Created September 10, 2023 07:41 — forked from stevesie88/instagram_generic_embed_template.html
Embed Any Instagram Post Using Only the Shortcode
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/{{ ig_shortcode }}/?utm_source=ig_embed&amp;utm_campaign=loading" data-instgrm-version="12" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);">
<div style="padding:16px;">
<a href="https://www.instagram.com/p/{{ ig_shortcode }}/?utm_source=ig_embed&amp;utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank">
<div style=" display: flex; flex-direction: row; align-items: center;">
<div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div>
<div style="display: flex; flex-direction: column; flex-grow: 1; jus
@bran921007
bran921007 / spammer.js
Created March 11, 2023 18:55 — forked from StephanStanisic/spammer.js
Whatsapp spammer for tampermonkey: With GUI!
// ==UserScript==
// @name w8pp spammer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://web.whatsapp.com/
// @grant none
// ==/UserScript==
"use strict";function send(e){document.getElementsByClassName("pane-header pane-chat-header")[0].getElementsByClassName("emojitext ellipsify")[0].innerHTML==whitelist&&(document.getElementsByClassName("icon icon-smiley btn-emoji")[0].click(),document.getElementsByClassName("input")[1].innerHTML=e,document.getElementsByClassName("menu-item")[pagee].click(),document.getElementsByClassName("emojik emojiordered"+emoji)[0].click(),document.getElementsByClassName("icon btn-icon icon-send send-container")[0].click())}function addListeners(){document.getElementById("dyx").addEventListener("mousedown",mouseDown,!1),window.addEventListener("mouseup",mouseUp,!1)}function mouseUp(){window.removeEventListener("mousemove",divMove,!0)}function mouseDown(e){window.addE
@bran921007
bran921007 / pagedpopup.js
Created January 21, 2023 20:04 — forked from odoe/pagedpopup.js
A custom popup pager for multiple features for use with Leaflet.js.
/*jshint laxcomma:true*/
/**
* The following uses RxJS to handle the
* next/prev click event stream
* https://github.com/Reactive-Extensions/RxJS
* Could substitute with regular addEventListener
* if desired.
*
* It also uses font-awesome for next/prev icons

MS Office activation

Steps

  1. Download and install Office 365

  2. Remove current trial license

  3. Open command prompt as admin

  4. Navigate to the Office folder

@bran921007
bran921007 / morse.rb
Created March 19, 2022 05:46 — forked from trejo08/morse.rb
Morse Code translator written in Ruby as solution of CodementorX Assessment.
class Morse
def posibilities(signals)
signals.include?('?') ? check_wildcard(signals) : morses["#{signals}"]
end
def check_wildcard(signals)
length = signals.split('').length
values = []
if length.eql?(1)
values = ["E", "T"]
@bran921007
bran921007 / AppServiceProvider.php
Created February 16, 2022 06:09 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@bran921007
bran921007 / settings.json
Created January 23, 2022 00:46 — forked from aschmelyun/settings.json
VS Code Settings
{
"editor.codeLens": false,
"workbench.colorTheme": "Atom One Dark",
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
"editor.selectionHighlight": false,
"editor.highlightActiveIndentGuide": false,