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 / strtocamel.php
Created June 22, 2017 00:47
String to CamelCase
<?php
function strtocamel($str, $separator = '_', $replace = true)
{
return str_replace($separator, $replace ? '' : $separator, ucwords($str, $separator));
}
@sayhicoelho
sayhicoelho / strtosnake.php
Created June 22, 2017 00:48
String to snake_case
<?php
function strtosnake($str)
{
return ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $str)), '_');
}
@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 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 / FacebookPageInvite.js
Last active October 19, 2017 00:36
Facebook: Invite your friends to like a Page
var list = document.getElementsByClassName('lists')[0];
var min = 500; // ms
var max = 1500; // ms
var time = min;
var interval;
var timeout;
var invited = 0;
var limit = 999;
var stop = false;
@sayhicoelho
sayhicoelho / CheckRole.php
Last active November 3, 2017 19:21
Trait to manage user ACL
<?php
namespace App\Traits;
trait CheckRole
{
/**
* The roles that belong to the user.
*/
public function roles()
@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 / 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 / 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;