Skip to content

Instantly share code, notes, and snippets.

View antimech's full-sized avatar

Artur Gauzer antimech

View GitHub Profile
@antimech
antimech / auth.js
Last active October 2, 2023 15:24
JQuery smart auth script with Google reCAPTCHA
$('#sign-up form').submit(function (event) {
var $this = $(this),
email = $this.find("input[name='email']").val(),
password = $this.find("input[name='password']").val(),
repeatPassword = $this.find("input[name='repeatpassword']").val(),
captcha = grecaptcha.getResponse(widgetId1);
if (password !== repeatPassword) {
document.querySelector('#sign-up form input[name="repeatpassword"]').setCustomValidity('Passwords mismatch');
event.preventDefault();
@antimech
antimech / ext.php
Last active May 28, 2023 06:29
Laravel, subscription renewal for Telegram Bot Users
<?php
if (!auth()->user()) {
return abort(401);
}
$users = \App\TelegramBotUser::subscribers();
echo $users->count();
echo '<br>';
@antimech
antimech / coinbase-commerce-create-checkout.php
Last active November 22, 2023 08:40
Create subscriptions plans (checkout) through Coinbase Commerce
#!/usr/bin/env php8.1
<?php
// $ composer require antimech/coinbase:^0.11.0
require __DIR__ . '/vendor/autoload.php';
$coinbase = new Coinbase;
// Promotion
@antimech
antimech / Pusher.html
Last active May 28, 2023 06:29
The frontend part of the example of using private channel with Pusher WebSocket Server and Laravel
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
<script>
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('key_here', {
@antimech
antimech / calc.php
Last active November 22, 2023 08:39
Калькулятор с использованием библиотеки chriskonnertz/string-calc. $ php calc.php и введите ваше выражение, например: 1+2*4+(4*4)
#!/usr/bin/env php8.1
<?php
// $ composer require chriskonnertz/string-calc:^2.0.0
require __DIR__ . '/vendor/autoload.php';
$stringCalc = new ChrisKonnertz\StringCalc\StringCalc();
$term = trim(fgets(STDIN)); // reads one line from STDIN
@antimech
antimech / brute-force-loki-wallet.sh
Last active November 22, 2023 08:28
Loki Wallet BruteForce Password Recovery. Helps if you forgot the password. The command line tools required: https://github.com/loki-project/loki/releases/latest
#!/usr/bin/env bash
start=`date +%s` # save start time
tries=0 # tries counter
dictionary=/usr/share/dict/words # you can specify your own dictonary
for word in $(< $dictionary);
do echo "Trying: $word";
((tries++))
echo -e "wallet.keys\n$word" | ./loki-wallet-cli | egrep "^Opened wallet" && echo -e "\nThe passphrase is: $word\n" && break;
@antimech
antimech / botman-telegram-inline-keyboard.php
Last active May 28, 2023 06:18
Botman 2.0 Telegram inline keyboard snippet
<?php
$welcomeMessage = 'Hello and welcome! This is a very cool service behind a paywall. Get started today!';
$keyboard = [
'Get a free trial for 5 days',
'Check FAQ'
];
// Reply to user
@antimech
antimech / botman.php
Last active November 22, 2023 08:24
BotMan 2.0 + Laravel: Telegram Bot user profile picture snippet. The user have to `/start` the bot first.
<?php
$userId = 16246463;
// Get a list of profile pictures for a user
$userProfilePictures = $this->bot->sendRequest('getUserProfilePhotos', [
'user_id' => $userId,
]);
info($userProfilePictures);
@antimech
antimech / ac_proton.sh
Last active May 28, 2023 05:14 — forked from thrimbor/ac_proton.sh
Assetto Corsa on Proton. Not tested.
# Change to Windows XP
protontricks 244210 winxp
# Uninstall .NET/Mono (manually)
protontricks 244210 uninstaller
echo 'Uninstall all stuff related to .NET or Mono.'
# Install .NET 4.0
protontricks 244210 --force -q dotnet40
@antimech
antimech / Quake4Config.cfg
Created November 28, 2019 07:34
This config fixes blurry textures in black screen. Put it in "Quake 4/q4base" directory.
unbindall
bind "RIGHTALT" "_strafe"
bind "RIGHTCTRL" "_attack"
bind "RIGHTSHIFT" "_speed"
bind "LEFTALT" "_strafe"
bind "LEFTCTRL" "_attack"
bind "LEFTSHIFT" "_speed"
bind "TAB" "_impulse19"
bind "ESCAPE" "togglemenu"
bind "SPACE" "_moveup"