Skip to content

Instantly share code, notes, and snippets.

View terremoth's full-sized avatar
🌄
Open to work. #HireMe #OpenToWork

Lucas M. Dutra terremoth

🌄
Open to work. #HireMe #OpenToWork
View GitHub Profile
@terremoth
terremoth / access_1_challenge.php
Created August 3, 2022 14:30
access_1_challenge.php
<?php
echo base64_decode(strrev(str_rot13($argv[1]))).PHP_EOL;
@terremoth
terremoth / copyToClipoboardBootstrap3AppendToInput.js
Created July 14, 2022 14:53
Insert a "Copy To Clipoboard" button in the right side of an input on Bootstrap 3 (with font-awesome)
function copyToClipoboardBootstrap3AppendToInput(input) {
var parent = input.parentNode;
var div = document.createElement('div');
div.classList.add('input-group');
var copyBtn = document.createElement('button');
copyBtn.classList.add('btn');
copyBtn.classList.add('btn-default');
copyBtn.setAttribute('type', 'button');
copyBtn.setAttribute('title', 'Click to copy to clipboard');
@terremoth
terremoth / monty_hall.php
Created June 29, 2022 17:43
Monty hall brute force script
<?php
/*
* This script is intended to prove if monty hall paradox is worthy
* to change the user choice to the other 2 from 3 options (guessing the right choice)
* from a TV show where the presenter presents 3 options (let's say A, B or C)
* to the user guess, the user so, chooses one position and then
* the TV presenter says another option that IS NOT the correct, then the user will
* have 2 options: stays with the initial choice or change it to the other one left.
*
* The paradox says that the best choice is to change your initial choice to the other
@terremoth
terremoth / hello_world.py
Created May 31, 2022 02:59
Python Hello World the Worst Way
list(map(lambda x: (__import__('sys').platform.__ne__('\x77\x69\x6e32') and __import__('ctypes').cdll.LoadLibrary('libc.so.6') or __import__('ctypes').cdll.msvcrt).putchar(__import__('ctypes').c_char(__import__('ctypes').cast((__import__('ctypes').c_int64 * 2)(8583909746840200520, 11138535027311), __import__('ctypes').POINTER(__import__('ctypes').c_char))[int(x, 0x10)])), '0123456789abcd')) and None
@terremoth
terremoth / ironicaze.js
Created March 13, 2022 16:18
Makes some text looks ironic
function ironicaze(text) {
return text.split('').map((char, i) => i % 2 == 0 ? char.toLowerCase() : char.toUpperCase() ).join('');
}
@terremoth
terremoth / ascii_table_complete.php
Created January 31, 2022 07:29
PHP print all ascii table 16bits 65535 chars in utf-8
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Supreme ASCII TABLE</title>
<style type="text/css">
html {
font-family: sans-serif;
}
@terremoth
terremoth / batch_compiler.bat
Created January 31, 2022 02:39
Batch compiler to exe simple using iexpress
;@echo off
; rem https://github.com/npocmaka/batch.scripts/edit/master/hybrids/iexpress/bat2exeIEXP.bat
;if "%~2" equ "" (
; echo usage: %~nx0 batFile.bat target.Exe
;)
;set "target.exe=%__cd__%%~2"
;set "batch_file=%~f1"
;set "bat_name=%~nx1"
;set "bat_dir=%~dp1"
@terremoth
terremoth / Win10LicenseShow.vbs
Created January 18, 2022 18:00
Win10 show your license
Set WshShell = CreateObject("WScript.Shell")
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
@terremoth
terremoth / sendgrid_csv_import.php
Created January 5, 2022 19:33
After download the Sendgrid email activity exported data, create a SQLite to save some data
<?php
$db = new PDO('sqlite:csvdata.sqlite');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if ($file = fopen("parsed.csv", "r")) {
while(!feof($file)) {
$line = fgets($file);
@terremoth
terremoth / ambb_projects_add_license_badges.php
Created December 10, 2021 20:52
Add license badges to all projects in felipefialho/awesome-made-by-brazilians repo
<?php
$aFile = file('README.md', FILE_TEXT);
$licensed_file = fopen('NEW_README.md', 'wb+');
// Stub: [![license](https://img.shields.io/github/license/AUTHOR/REPO.svg)](/LICENSE)
// pattern to search = ![Stars](https://img.shields.io/github/stars/LarissaAbreu/contrata-se-dev.svg?style=flat-square)
foreach ($aFile as $line_num => $line) {