Skip to content

Instantly share code, notes, and snippets.

View Karasiq's full-sized avatar
🤔
Солнце ещё высоко

Amynov Islam Methyl Ogly Karasiq

🤔
Солнце ещё высоко
View GitHub Profile
@Karasiq
Karasiq / save_group_participants.py
Created December 22, 2023 13:37
Export telegram group participants (message authors)
import asyncio
import logging
import os
import pathlib
import re
import shutil
from datetime import datetime, timedelta
from telethon import TelegramClient
from telethon.tl.functions.messages import GetDialogsRequest
@Karasiq
Karasiq / Send.psm1
Last active November 21, 2022 15:45
Mozilla Send and Gofile Upload PowerShell script/module
function SendUploadFile {
[CmdletBinding(SupportsShouldProcess)]
param (
[string]$Path,
[switch]$Silent = $false
)
$SendHosts = ("https://send.portailpro.net","https://send.ephemeral.land")
$BaseDir = $env:UserProfile + "\Send"
$LogsDir = $env:Temp + "\send_logs"
@Karasiq
Karasiq / hhupdate.php
Last active April 7, 2023 20:51
HH.ru resume update script
<?php
$client_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$client_secret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
if (empty($_GET['code'])) {
echo '<p><a href="https://hh.ru/oauth/authorize?response_type=code&client_id=' . $client_id . '">Обновить резюме</a></p>';
} else {
if ($curl = curl_init()) {
curl_setopt($curl, CURLOPT_URL, 'https://hh.ru/oauth/token');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
@Karasiq
Karasiq / clean_sbt_target.py
Last active February 11, 2022 14:50
Clean sbt target directories
if __name__ == '__main__':
from pathlib import Path
def rmdir(directory, cond):
directory = Path(directory)
should_delete: bool = cond(directory)
try:
for item in directory.iterdir():
if item.is_dir():
rmdir(item, lambda d: should_delete or cond(d))
# ./ffmpeg_vp9_2pass.sh input.mp4 2M 96k 1920 60
set -x
input="$1"
bitrate="${2:-2M}"
audio_bitrate="${3:-96k}"
scale="'min(${4:-1920},iw)':'ih*$4/iw'"
fps="${5:-60}"
@Karasiq
Karasiq / Test.java
Created July 3, 2020 12:32
Refined scala calls demo
import com.wavesplatform.account.Address;
import com.wavesplatform.account.KeyPair;
import com.wavesplatform.common.state.ByteStr;
import com.wavesplatform.state.DataEntry;
import com.wavesplatform.transaction.Asset;
import com.wavesplatform.transaction.DataTransaction;
import com.wavesplatform.transaction.Proofs;
import com.wavesplatform.transaction.smart.InvokeScriptTransaction;
import com.wavesplatform.transaction.smart.SetScriptTransaction;
import com.wavesplatform.transaction.transfer.TransferTransaction;
@Karasiq
Karasiq / Test.java
Created July 3, 2020 11:16
scala waves transactions test
import com.wavesplatform.account.Address;
import com.wavesplatform.account.KeyPair;
import com.wavesplatform.common.state.ByteStr;
import com.wavesplatform.lang.script.Script;
import com.wavesplatform.lang.v1.FunctionHeader;
import com.wavesplatform.lang.v1.compiler.Terms;
import com.wavesplatform.lang.v1.estimator.ScriptEstimator;
import com.wavesplatform.state.DataEntry;
import com.wavesplatform.state.IntegerDataEntry;
import com.wavesplatform.state.StringDataEntry;
@Karasiq
Karasiq / test.java
Created July 3, 2020 11:15
waves-transactions-test
package im.mak.waves.transactions;
import im.mak.waves.crypto.account.PrivateKey;
import im.mak.waves.crypto.account.PublicKey;
import im.mak.waves.crypto.account.Seed;
import im.mak.waves.transactions.common.*;
import im.mak.waves.transactions.invocation.Function;
import im.mak.waves.transactions.invocation.StringArg;
import java.util.ArrayList;
val file = "/Users/user/Downloads/waves.log"
val regex = s"${Regex.quote("http://.wvservices.com:6869")}(/.*)".r.unanchored
val result = Source
.fromFile(file)
.getLines()
.collect { case regex(url) ⇒ url }
.map(s => "\"" + s + "\"")
.toSet
.mkString(",\n")
println(result)
import scala.io.StdIn
import scala.language.{implicitConversions, postfixOps}
import scodec.bits.ByteVector
import Types.{ReqDHParams, ReqPQ, ResPQ}
import akka.actor.ActorSystem
import akka.stream.scaladsl.Tcp
import akka.stream.ActorMaterializer
import akka.util.ByteString
import scodec.{Codec, DecodeResult}