This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stdin = fopen('php://stdin', 'r'); | |
system('stty cbreak -echo'); | |
stream_set_blocking($stdin, false); | |
while (1) { | |
if ($keypress = fgets($stdin)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MIT License | |
Copyright (c) 2024 Terremoth (github.com/terremoth) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// change credentials below and then run this php script from terminal | |
$driver = 'mysql'; | |
$host = 'localhost'; | |
$port = 3306; | |
$dbname = 'test'; | |
$user = 'root'; | |
$password = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author terremoth | |
* @license GNU General Public License, version 3 | |
*/ | |
$stream = file_get_contents("php://stdin"); | |
$rows = explode("\n", $stream); | |
foreach ($rows as $row) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
number: int = 1_000_000_000 | |
print(number) # 1000000000 | |
print(f'{number:_}') # 1_000_000_000 | |
print(f'{number:,}') # 1,000,000,000 | |
var: str = 'var' | |
print(f'{var:>20}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Output "Zeus Package Manager for AthenaEnv PS2 libraries and Modules" | |
Write-Output "Made by github.com/terremoth" | |
$command = $args[0] | |
$library = $args[1] | |
$modulesDir = "athena_libs" | |
$libPath = "https://api.github.com/repos/terremoth/athenaenv-libs/contents/"+$library | |
$packageManagerFunction = "install", "update", "remove", "search" | |
$actualPath = $pwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui | |
import random | |
import time | |
import keyboard | |
screenWidth, screenHeight = pyautogui.size() | |
def random_sleep(): | |
return random.uniform(0.625, 1.555) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Disk size: ".disk_total_space("D:").PHP_EOL; | |
$disk = fopen('\\\\.\\D:', 'rb+'); //escaping the escape | |
$chunk_size = 4096; | |
while (!feof($disk)) { | |
$bin_data = fread($disk, 4096); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$is_terminal = php_sapi_name() == "cli"; | |
$td_tag_init = "\t".'<td>'; | |
$td_tag_end = '</td>'.PHP_EOL; | |
$tr_tag_init = '<tr>'.PHP_EOL; | |
$tr_tag_end = '</tr>'.PHP_EOL; | |
$to_html_init = '&#'; | |
$to_html_end = ';'; | |
$new_line_code = '<br>'.PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function quanto_cobrar(quanto_quero_ganhar, taxa_de_desconto) { | |
let i = 0; | |
function loop(valor) { | |
let resultado = parseFloat((valor - (valor * taxa_de_desconto)).toFixed(2)); | |
let acrescentar = parseFloat((valor - resultado).toFixed(2)); | |
NewerOlder