Skip to content

Instantly share code, notes, and snippets.

View drolean's full-sized avatar
🎯
Focusing

Leandro Ross drolean

🎯
Focusing
View GitHub Profile
</script><div><script id="__LOADABLE_REQUIRED_CHUNKS__" type="application/json">[]</script><script id="__LOADABLE_REQUIRED_CHUNKS___ext" type="application/json">{"namedChunks":[]}</script></div><script>window.__ServerRenderSuccess__=true;</script></div><script>window.__SSR__=1;</script><script>window.__CHUNK_DATA__={};window.rawData={"store":{"$service":{},"$ctx":null,"$atomValue":{"atoms":{"GetActionsAtom":{},"PortalAtom":{"value":{"portals":{},"count":0}}}},"lang":"pt-BR","headAndFootStaticConfigs":{},"pageSn":10032,"needHeadData":true,"needFootData":true,"webLayoutData":{"commonData":{"pageSn":10032,"expConfig":{"cp173461":{"style":1},"cp124366":{"style":1,"prerender":1,"strictCheck":true,"prefetch":1},"cp100923":{"style":1},"cp108687":{"value":true},"cp166196":{},"cp166198":{},"cp162938":{},"cp169337":{},"cp169338":{},"cp173985":{"value":true,"isPrerender":true,"delay":90,"key":"view_transition_C","isViewTransition":true},"cp175412":{"autoExpand":false,"maxRows":6},"cp175415":{"autoExpand":false
@drolean
drolean / puppeteer-bot.js
Created May 27, 2021 01:05 — forked from julionc/puppeteer-bot.js
disguisePage - undetectable puppeteer
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 3000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Mobile Intel(R) 4 Seri
@drolean
drolean / download_emails.py
Created March 1, 2021 00:54 — forked from PandaWhoCodes/download_emails.py
A script to download emails from gmail - http://www.ashish.ch
import imaplib
import email
import os
def create_folder(folder_name="backup"):
"""
Creates a folder to store all mails
"""
if not os.path.exists(folder_name):
@drolean
drolean / Enums.php
Created October 23, 2017 12:33 — forked from jhoff/Enums.php
Laravel Model Enumeration Trait
<?php
namespace App\Traits;
use Illuminate\Support\Str;
use App\Exceptions\InvalidEnumException;
trait Enums
{
/**
public function index(Request $request, Patrimonio $patrimonio, Setor $setor)
{
$dtinicio = $request->input('datainicial');
$dtfim = $request->input('datafinal');
$setorpes = $request->input('setorpes');
//$this->authorize('visual_Cadastro');
//Traz os dados de cada Model e faz a ordenação
$patrimonios = $patrimonio::orderBy('situacaopatrimonio', 'ASC')->whereBetween('date',[$dtinicio, $dtfim])->paginate($this->totalPage);
@drolean
drolean / gist:053625f3b91112b076e848f74f657a23
Created September 18, 2017 17:28 — forked from nternetinspired/gist:7482445
Load Disqus comments only on demand if you give a shit about page weight and your visitors. Even with no comments, i.e. an empty comment form, calling Disqus will load an extra 226Kb. If your page has comments this can be far higher. This Gist accompanies my blog post: http://internet-inspired.com/wrote/load-disqus-on-demand/
// Requires jQuery of course.
$(document).ready(function() {
$('.show-comments').on('click', function(){
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username.
// ajax request to load the disqus javascript
$.ajax({
type: "GET",
url: "http://" + disqus_shortname + ".disqus.com/embed.js",
dataType: "script",
Process[] processes = Process.GetProcessesByName("notepad");
foreach (Process p in processes)
{
var pFilterList = new IntPtr[1];
pFilterList[0] = p.MainWindowHandle;
if (MagSetWindowFilterList(Handle, MagnifierFilterMode.MwFiltermodeExclude, pFilterList))
return;
}
https://msdn.microsoft.com/en-us/library/windows/desktop/ms692395(v=vs.85).aspx
// Set the callback function
if (!MagSetImageScalingCallback(hwndMag, (MagImageScalingCallback)MagImageScaling))
{
return FALSE;
}
BOOL MagImageScaling(HWND hwnd, void *srcdata, MAGIMAGEHEADER srcheader,
@mixin scrollbars($size, $foreground-color, $background-color: mix($foreground-color, white, 50%)) {
::-webkit-scrollbar {
width: $size;
height: $size;
}
::-webkit-scrollbar-thumb {
background: $foreground-color;
}
site.com.br/300x250/original/2017/04/06/f96cf7211a_unnamed.jpg
{tipo} /{imagem}
Route::get('/{tipo}/{imagem}', [
'as' => 'media.imagem',
'uses' => 'MediaController@GeraImagem'
])->where(['imagem' => '(original(.*))']);