Skip to content

Instantly share code, notes, and snippets.

View teidesu's full-sized avatar
🌸
meow?

alina sireneva teidesu

🌸
meow?
View GitHub Profile
@teidesu
teidesu / PlayPauseIcon.vue
Created June 22, 2021 13:11
Play-Pause animated icon for Vue.
<template>
<svg
ref="svg"
height="100%"
width="100%"
viewBox="0 0 24 24"
class="play-pause-icon"
>
<path ref="path1" d=""></path>
<path ref="path2" d=""></path>
@teidesu
teidesu / bookmarklet.js
Created June 22, 2021 13:11
base for toggleable css injection bookmarklet
javascript:(function() {
var ID = '__INJECTED__STYLE__'
var CSS = '.foo {}'
var w=window,el;if(w[ID]){w[ID].remove();delete w[ID];return};el=document.createElement('style');el.innerHTML=CSS;w[ID]=el;document.head.appendChild(el)
})()
@teidesu
teidesu / tg-stickers-downloader.js
Created June 22, 2021 13:11
Really small and simple script for downloading sticker sets from telegram
const axios = require('axios')
const fs = require('fs')
const path = require('path')
const token = 'YOUR_BOT_TOKEN'
// vvv UNCOMMENT TO USE PROXY vvv
// const SocksProxyAgent = require('socks-proxy-agent')
// const agent = new SocksProxyAgent('socks5://127.0.0.1:9150')
// axios.defaults.httpAgent = agent
@teidesu
teidesu / sourcemap-extractor.js
Last active September 23, 2022 12:19
Simple tool for extracting source code from sourcemaps.
/**
* Simple tool for extracting source code from sourcemaps.
* Requires axios for automatic fetching.
* Puts extracted files in ./<sourcemap_file_name>_extracted/
* Puts files from `../` (for example, webpack puts there node_modules) dir to _extracted/__/,
* and files from `./` to _extracted/
*
* (c) teidesu 2019. Licensed under GPLv3.
*/
/*
* Script for checking whether the Telegram username is occupied.
* Uses t.me (or its mirrors, configurable as a second parameter), so there are no
* flood limits.
* Usage:
* const checkUsername = require('./tg-username-checker')
* // ...
* await checkUsername('someone')
* await checkUsername('someone', 'telesco.pe')
* Alternatively, can be used as an interactive CLI when ran directly.
@teidesu
teidesu / vk-audio.js
Created June 22, 2021 13:11
VK token refresh script for audio in JS, based on Vodka2 implementation
/*
* VK token refresh script for audio.
* The only dependency is axios.
* Can be simply embedded in your app:
* const { refreshToken } = require('./vk-audio')
* ...
* refreshToken(oldToken)
*
* Note that you will need to use Kate Mobile's token and user agent, for example:
* KateMobileAndroid/52.1 lite-445 (Android 4.4.2; SDK 19; x86; unknown Android SDK built for x86; en)
@teidesu
teidesu / ym_recognition.py
Created June 22, 2021 13:11
small script that (ab)uses Yandex Music Recognition.
"""
This is small script that (ab)uses Yandex Music Recognition.
I hope the code is self-documented <3
Notice! Input file should be .ogg file, preferably with libopus encoder
(untested with other encoders)
(c) teidesu, 2019. This script is licensed under GPLv3 license.
"""
import lomond
import uuid as uuid_py
@teidesu
teidesu / telegram_postgres_backup.sh
Created June 22, 2021 13:11
small script for automating postgres database backup and sending it to telegram
#!/bin/bash
# To generate public key:
# openssl req -x509 -nodes -days 1000000 -newkey rsa:4096 -keyout backup_key.pem\
# -subj "/C=US/ST=Illinois/L=Chicago/O=IT/CN=www.example.com" \
# -out backup_key.pem.pub
#
# To decrypt:
# openssl smime -decrypt -in some.bin -binary -inform DEM -inkey your.pem | bzcat > some.pg
@teidesu
teidesu / update-cf-dns.sh
Created June 22, 2021 13:11
update ip in cloudflare dns for those nibbas who has dynamic ip
#!/bin/bash
API_KEY="..."
ZONE_ID="..."
RECORD_ID="..."
ADDRESS="..."
curl -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" --data "{\"type\": \"A\", \"name\": \"$ADDRESS\", \"content\": \"$(curl ipv4.icanhazip.com)\", \"proxied\": false}"
@teidesu
teidesu / firefox-pass-export.js
Created June 22, 2021 13:11
Small script for exporting passwords from Firefox Lockwise to Chrome CSV
/*
Small script for exporting passwords from Firefox Lockwise to Chrome CSV
Usage:
1. Open passwords page (about:logins)
2. Open devtools (F12)
3. Paste the following script
4. Wait a few seconds, a download prompt will appear.
Tested with 70.0.1 (64-bit) (Linux x64)
(c) teidesu 2019. This script is licensed under GPLv3