Skip to content

Instantly share code, notes, and snippets.

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

Renan Coelho sayhicoelho

🏠
Working from home
View GitHub Profile
@sayhicoelho
sayhicoelho / FacebookPokeFriends.js
Created August 22, 2017 23:36
Facebook: Poke your friends like a boss!
setInterval(function () {
var poke_buttons = document.querySelectorAll('._4-u2._xct._4-u8 ._42ft._4jy0._4jy3._4jy1.selected._51sy');
for (var i = 0; i < poke_buttons.length; i++) {
poke_buttons[i].click();
}
}, 2000);
@sayhicoelho
sayhicoelho / no-adblock.js
Created August 27, 2017 23:27
Script para detectar se há AdBlock sendo utilizado pelo seu visitante
window.onload = function () {
var ads = document.querySelectorAll('.adsbygoogle');
var isReal = true;
for (var i = 0; i < ads.length; i++) {
if (ads[i].innerHTML.length === 0) isReal = false; break;
}
if (!isReal) {
@sayhicoelho
sayhicoelho / FacebookAcceptAllFromFriendList v1.js
Last active January 25, 2018 00:37
Facebook: The easiest way to accept all of friend request list
var interval;
var scrollInterval;
var index = 0;
var container = document.querySelector('.mtl._30d._5ewg._5n-u > div:nth-child(3) > div');
interval = setInterval(function () {
var friendRequests = container.querySelectorAll('.friendRequestItem');
var button = friendRequests[index].querySelector('button.selected');
button.click();
index++;
@sayhicoelho
sayhicoelho / FacebookAcceptAllFromFriendList v2.js
Created October 16, 2017 19:34
Facebook: The easiest way to accept all of friend request list
var interval;
var morePagerInterval;
var index = 0;
interval = setInterval(function() {
console.clear();
var requests = document.querySelectorAll('.friendRequestItem');
@sayhicoelho
sayhicoelho / Paginator.vue
Last active June 5, 2022 19:05
A Laravel pagination for Vue.js
<template>
<nav aria-label="Page navigation" v-if="paginationTotal > 1">
<ul :class="{ 'pagination': true, 'flex-wrap': true, 'justify-content-center': centered }">
<li :class="{ 'page-item': true, 'disabled' : currentPage <= 1 }">
<a class="page-link" href="#" @click.prevent="pageChanged(currentPage - 1)" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
<template v-if="needLeftDots">
<li v-for="n in 2" :key="n" :class="activePage(n)">
@sayhicoelho
sayhicoelho / Friendship.php
Created January 5, 2018 07:25
Laravel: A Trait for friendship.
<?php
namespace App\Traits;
use App\User;
trait Friendship
{
public function solicitationsOfMine()
{
@sayhicoelho
sayhicoelho / fuck-ie.html
Last active January 24, 2018 21:13
Internet Explorer no more!
<!--[if lt IE 11]>
<div align="center" style="z-index: 999; font-size: 16px; line-height: 24px; position: fixed; box-sizing: border-box; top: 0; left: 0; width: 100%; padding: 20px; background-color: #dd0000; color: white; font-family: sans-serif; font-weight: 900">
Your browser is outdated. Please <a target="_blank" style="color: white; text-decoration: underline;" href="https://www.google.com/chrome/browser/desktop/index.html">click here</a> to download a new browser.
</div>
<div align="center" style="z-index: 999; font-size: 16px; visibility:hidden; line-height: 24px; box-sizing: border-box; top: 0; left: 0; width: 100%; padding: 20px; font-family: sans-serif; font-weight: 900">
Your browser is outdated. Please click here to download a new browser.</a>.
</div>
<![endif]-->
<!--[if !IE]><!-->
@sayhicoelho
sayhicoelho / remove-tweets.js
Created May 26, 2018 01:35
Twitter: Automate Removing Tweets From Browser Console
var str = 'Adicionei um vídeo a uma playlist';
function doDropdownDelete() {
var tweets = document.querySelectorAll('.js-tweet-text-container > p:first-child');
console.clear();
console.error(tweets.length);
for (var i = 0; i < tweets.length; i++) {
var text = tweets[i].textContent;
@sayhicoelho
sayhicoelho / Macchanger.sh
Created July 1, 2018 17:18
This snippet of code will change your MAC Address and try to connect to a service that blocks the user's MAC Address after some minutes.
#!/bin/bash
declare -i count=0;
while true; do
count=count+1;
now=$(date +"%d/%m/%y %T");
echo "Execução de número "$count;
echo "Iniciado em: $(tput setaf 2)"$now"$(tput sgr0)";
echo ;
nmcli d disconnect wlan0
@sayhicoelho
sayhicoelho / README.md
Last active September 19, 2018 15:36
A simple flash function for Express applications using Node.

Node & Express flash messages

Using this bit of code you will able to pass flash messages between requests, i.e you can pass old inputs passed by the last request, errors and custom strings, objects and arrays.

Usage

app.post('/login', (req, res) => {
  if (false) {
    req.flash('input', {
      username: req.body.email
 })