Skip to content

Instantly share code, notes, and snippets.

leonelsr / xmrigidle.ahk
Last active Jun 2, 2020
AutoHotkey XMRig controller tool - Dynamically changes XMRig settings when PC is idle for some time
View xmrigidle.ahk
#SingleInstance force ; Skips the dialog box and replaces the old instance automatically
SetWorkingDir %A_ScriptDir%
* XMRig controller tool
* Can be used to dynamically change XMRig settings whenever PC is idle for some time
* At the bottom of this file, there is an example of config.json file for reference
View sddsCEVA.html
<!DOCTYPE html><html lang="en"><head>
<title>SDDS CEVA | 30 do Hellboy</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href=""/>
<script src=""></script>
<script src=""></script>
View GloboFullTab.meta.js
// ==UserScript==
// @name Globo Full Tab
// @namespace
// @version 0.1.3
// @downloadURL
// @description Cria um botão para deixar em Tela Cheia (ou "aba cheia") qualquer vídeo em (inclusive G1, Globo Play ou Globosat Play).
// @author @leonelsr
// @match *://**
// @grant none
// ==/UserScript==
View test-php-basic-auth.php
function require_auth() {
$AUTH_USER = 'admin';
$AUTH_PASS = 'admin';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
leonelsr / DESPERTADOR.cmd
Last active Apr 6, 2019
Despertador com windows batch e task scheduler
@echo off
SET mpchc="C:\Program Files\MPC-HC\mpc-hc64.exe"
SET imperial="C:\Users\Leonel\Music\John Williams\The Greatest Hits_ 1969-1999 Disc 1\10 'The Imperial March' from The Emp.m4a"
SET dontlie="C:\Users\Leonel\Music\The Black Eyed Peas\Monkey Business\04 Don't Lie.m4a"
SET hedwig="C:\Users\Leonel\Music\John Williams\Harry Potter And The Philosopher's Stone\19 Hedwig's Theme.m4a"
SET starwars="C:\Users\Leonel\Music\John Williams\The Greatest Hits_ 1969-1999 Disc 1\01 Star Wars (Main Title) [From Star.m4a"
leonelsr / OldTwitterAvatar.user.js
Last active Apr 6, 2019
Twitter and Tweetdeck #OldTwitter Avatar
View OldTwitterAvatar.user.js
// ==UserScript==
// @name Twitter and Tweetdeck #OldTwitter Avatar
// @namespace
// @version 0.1.2
// @downloadURL
// @description Bring the old square Avatar back to Twitter and TweetDeck!
// @author @leonelsr
// @match
// @match*
// @grant none
leonelsr / bash_background.vbs
Last active Dec 31, 2021
Run bash (Windows Subsystem for Linux) in background, in order to keep background processes running in WSL
View bash_background.vbs
' Windows Devs said on the developer feedback asking for cron, deamons and background tasks:
' "This first release of Bash/WSL doesn’t support background tasks, cron jobs, daemons, etc.
' Currently, when you close your last bash shell console window, we tear-down the Linux process
' chain in order to conserve resources."
' That's the workaround for now.
' You can run it on boot, for example, and it'll keep a instance of bash running alone in the background
' allowing background processes to run on WSL.
Set WshShell = CreateObject("WScript.Shell")

Keybase proof

I hereby claim:

  • I am leonelsr on github.
  • I am leonelsr ( on keybase.
  • I have a public key ASAU8GXH2lcMuHHWLVNfvXym7VfTPeiPMQ344hgNSx1hGgo

To claim this, I am signing this object:

View threads.c
/* Use 100% CPU on multithreaded Windows systems */
#include <Windows.h>
#include <stdio.h>
#define NUM_THREADS 4
DWORD WINAPI mythread(__in LPVOID lpParameter)
printf("Thread inside %d \n", GetCurrentThreadId());
leonelsr / resize-class.php
Created Aug 8, 2012
PHP Image crop and Resize helper class
View resize-class.php
# ========================================================================#
# Author: Jarrod Oberto
# Version: 1.1
# Date: 08-Aug-12
# Purpose: Resizes and saves or shows image
# Requires : Requires PHP5, GD library.
# Usage Example: