Skip to content

Instantly share code, notes, and snippets.

View rostegg's full-sized avatar
๐Ÿ’œ
Developing software with KISS principle in mind

Rostyslav Nikolaienko rostegg

๐Ÿ’œ
Developing software with KISS principle in mind
View GitHub Profile
@rostegg
rostegg / is-domain-alive.js
Created June 3, 2021 17:29
Check if domains is alive
const domains = [
`sci-hub.ws`,
`sci-hub.ac`,
`sci-hub.biz`,
`sci-hub.gq`,
`sci-hub.ga`,
`sci-hub.io`,
`sci-hub.nu`,
`sci-hub.name`,
`sci-hub.is`,
@rostegg
rostegg / enum-analogue.js
Last active May 28, 2021 12:36
Simple example of how to replace the lack of enums in JS
function* generateIds() {
let i = 0;
while (true) { yield i; i++ }
}
const generator = generateIds();
const getId = () => { return Object.freeze(generator.next().value) }
const typesList = [
/*index-begin-hide-tabs*/
#TabsToolbar {
visibility: collapse !important;
}
/*index-end-hide-tabs*/
/*index-begin-hide-sidebar-title*/
#sidebar-header {
visibility: collapse !important;
}
@rostegg
rostegg / vscode-quote-snippet
Created August 6, 2020 16:08
Snippet until quote mark key is broken
{
"Single quote mark": {
"prefix": ["sq"],
"body": ["''"],
"description": "Single quotatioms marks"
},
"Double quote mark": {
"prefix": ["dq"],
"body": ["\"\""],
"description": "Single quotatioms marks"
@rostegg
rostegg / trees-tab-style.css
Last active August 6, 2020 08:15
Custom style for Tree Style Tab webextension
:root {
--colorA: #ecff6b;
--colorB: #6affda;
--colorC: #b4b4b4;
--colorD: #5ceaff;
--colorE: #514350;
--colorF: #281f1a;
--colorG: green;
--tab-height: 30px;
--font-size: 11px;
PROFILE_DIR=~/.mozilla/firefox/$( ls -tr ~/.mozilla/firefox/ | grep -v profiles.ini | tail -1 )
if [ ! -d "${PROFILE_DIR}"/chrome ] ; then
mkdir -p "${PROFILE_DIR}"/chrome
fi
STYLE="#TabsToolbar { visibility: collapse !important; }"
echo ${STYLE} >> "${PROFILE_DIR}"/chrome/userChrome.css
@rostegg
rostegg / findAllWebTelegramMessages.js
Last active August 11, 2021 19:49
Find all messages in web telegram and save them to file
const filter = "the text by which messages will be filtered"
const fileName = "file.json"
function stripHtml(html){
const tmp = document.createElement("DIV")
tmp.innerHTML = html
return tmp.textContent || tmp.innerText || ""
}
function saveAs(data, filename){
@rostegg
rostegg / background.js
Last active July 9, 2020 06:13
Tiny webextension to navigate through random "prnt.sc" screenshots. Idk who might need it, purely for research purposes
// Load extension with manifest, and click on the icon that appears on browser panel
// And don't forget to load random pic to extension folder and name it "icon.png"
//
const endpoint = "https://prnt.sc"
browser.browserAction.onClicked.addListener(() => {
const rndId = (length) => {
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789'
const charactersLength = characters.length
const getRndChar = function() {
@rostegg
rostegg / unicode-emojis-arrays
Last active June 17, 2020 19:45
Large unicode emoji characters array (bash and js)
// bash
EMOJIS=(โ™ˆ โ™‰ โ™Š โ™‹ โ™Œ โ™ โ™Ž โ™ โ™ โ™‘ โ™’ โ™“ โ™  โ™ฃ โ™ฅ โ™ฆ โ™จ โ™ป โ™ฟ โš“ โš  โšก โšช โšซ โšฝ โšพ โ›„ โ›… โ›Ž โ›” โ›ช โ›ฒ โ›ณ โ›ต โ›บ โ›ฝ โœ‚ โœ… โœˆ โœ‰ โœŠ โœ‹ โœŒ โœ โœ’ โœ” โœ– โœจ โœณ โœด โ„ โ‡ โŒ โŽ โ“ โ” โ• โ— โค โž• โž– โž— โžก โžฐ โคด โคต โฌ… โฌ† โฌ‡ โฌ› โฌœ โญ โญ• ใ€ฐ ใ€ฝ ใŠ— ใŠ™ ๐Ÿ€„ ๐Ÿƒ ๐Ÿ…ฐ ๐Ÿ…ฑ ๐Ÿ…พ ๐Ÿ…ฟ ๐Ÿ†Ž ๐Ÿ†‘ ๐Ÿ†’ ๐Ÿ†“ ๐Ÿ†” ๐Ÿ†• ๐Ÿ†– ๐Ÿ†— ๐Ÿ†˜ ๐Ÿ†™ ๐Ÿ†š ๐Ÿ‡จ ๐Ÿ‡ณ ๐Ÿ‡ฉ ๐Ÿ‡ช ๐Ÿ‡ช ๐Ÿ‡ธ ๐Ÿ‡ซ ๐Ÿ‡ท ๐Ÿ‡ฌ ๐Ÿ‡ง ๐Ÿ‡ฎ ๐Ÿ‡น ๐Ÿ‡ฏ ๐Ÿ‡ต ๐Ÿ‡ฐ ๐Ÿ‡ท ๐Ÿ‡ท ๐Ÿ‡บ ๐Ÿ‡บ ๐Ÿ‡ธ ๐Ÿˆ ๐Ÿˆ‚ ๐Ÿˆš ๐Ÿˆฏ ๐Ÿˆฒ ๐Ÿˆณ ๐Ÿˆด ๐Ÿˆต ๐Ÿˆถ ๐Ÿˆท ๐Ÿˆธ ๐Ÿˆน ๐Ÿˆบ ๐Ÿ‰ ๐Ÿ‰‘ ๐ŸŒ€ ๐ŸŒ ๐ŸŒ‚ ๐ŸŒƒ ๐ŸŒ„ ๐ŸŒ… ๐ŸŒ† ๐ŸŒ‡ ๐ŸŒˆ ๐ŸŒ‰ ๐ŸŒŠ ๐ŸŒ‹ ๐ŸŒŒ ๐ŸŒ ๐ŸŒ‘ ๐ŸŒ“ ๐ŸŒ” ๐ŸŒ• ๐ŸŒ™ ๐ŸŒ› ๐ŸŒŸ ๐ŸŒ  ๐ŸŒฐ ๐ŸŒฑ ๐ŸŒด ๐ŸŒต ๐ŸŒท ๐ŸŒธ ๐ŸŒน ๐ŸŒบ ๐ŸŒป ๐ŸŒผ ๐ŸŒฝ ๐ŸŒพ ๐ŸŒฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ„ ๐Ÿ… ๐Ÿ† ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ“ ๐Ÿ” ๐Ÿ• ๐Ÿ– ๐Ÿ— ๐Ÿ˜ ๐Ÿ™ ๐Ÿš ๐Ÿ› ๐Ÿœ ๐Ÿ ๐Ÿž ๐ŸŸ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿค ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿช ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐Ÿฑ ๐Ÿฒ ๐Ÿณ ๐Ÿด ๐Ÿต ๐Ÿถ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ ๐Ÿป ๐ŸŽ€ ๐ŸŽ ๐ŸŽ‚ ๐ŸŽƒ ๐ŸŽ„ ๐ŸŽ… ๐ŸŽ† ๐ŸŽ‡ ๐ŸŽˆ ๐ŸŽ‰ ๐ŸŽŠ ๐ŸŽ‹ ๐ŸŽŒ ๐ŸŽ ๐ŸŽŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ‘ ๐ŸŽ’ ๐ŸŽ“ ๐ŸŽ  ๐ŸŽก ๐ŸŽข ๐ŸŽฃ ๐ŸŽค ๐ŸŽฅ ๐ŸŽฆ ๐ŸŽง ๐ŸŽจ ๐ŸŽฉ ๐ŸŽช ๐ŸŽซ ๐ŸŽฌ ๐ŸŽญ ๐ŸŽฎ ๐ŸŽฏ ๐ŸŽฐ ๐ŸŽฑ ๐ŸŽฒ ๐ŸŽณ ๐ŸŽด ๐ŸŽต ๐ŸŽถ ๐ŸŽท ๐ŸŽธ ๐ŸŽน ๐ŸŽบ ๐ŸŽป ๐ŸŽผ ๐ŸŽฝ ๐ŸŽพ ๐ŸŽฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ„ ๐Ÿ† ๐Ÿˆ ๐ŸŠ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿช ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ” ๐Ÿ— ๐Ÿ˜ ๐Ÿ™ ๐Ÿš ๐Ÿ› ๐Ÿœ ๐Ÿ ๐Ÿž ๐ŸŸ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿค ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐Ÿฑ ๐Ÿฒ ๐Ÿณ ๐Ÿด ๐Ÿต ๐Ÿถ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ ๐Ÿป ๐Ÿผ ๐Ÿฝ ๐Ÿพ ๐Ÿ‘€ ๐Ÿ‘‚ ๐Ÿ‘ƒ ๐Ÿ‘„ ๐Ÿ‘… ๐Ÿ‘† ๐Ÿ‘‡ ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ‘Š ๐Ÿ‘‹ ๐Ÿ‘Œ ๐Ÿ‘ ๐Ÿ‘Ž ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘‘ ๐Ÿ‘’ ๐Ÿ‘“ ๐Ÿ‘” ๐Ÿ‘• ๐Ÿ‘– ๐Ÿ‘— ๐Ÿ‘˜ ๐Ÿ‘™ ๐Ÿ‘š ๐Ÿ‘› ๐Ÿ‘œ ๐Ÿ‘ ๐Ÿ‘ž ๐Ÿ‘Ÿ ๐Ÿ‘  ๐Ÿ‘ก ๐Ÿ‘ข ๐Ÿ‘ฃ ๐Ÿ‘ค ๐Ÿ‘ฆ ๐Ÿ‘ง ๐Ÿ‘จ ๐Ÿ‘ฉ ๐Ÿ‘ช ๐Ÿ‘ซ ๐Ÿ‘ฎ ๐Ÿ‘ฏ ๐Ÿ‘ฐ ๐Ÿ‘ฑ ๐Ÿ‘ฒ ๐Ÿ‘ณ ๐Ÿ‘ด ๐Ÿ‘ต ๐Ÿ‘ถ ๐Ÿ‘ท ๐Ÿ‘ธ ๐Ÿ‘น ๐Ÿ‘บ ๐Ÿ‘ป ๐Ÿ‘ผ ๐Ÿ‘ฝ ๐Ÿ‘พ ๐Ÿค– ๐Ÿ‘ฟ ๐Ÿ’€ ๐Ÿ’ ๐Ÿ’‚ ๐Ÿ’ƒ ๐Ÿ’„ ๐Ÿ’… ๐Ÿ’† ๐Ÿ’‡ ๐Ÿ’ˆ ๐Ÿ’‰ ๐Ÿ’Š ๐Ÿ’‹ ๐Ÿ’Œ ๐Ÿ’ ๐Ÿ’Ž ๐Ÿ’ ๐Ÿ’ ๐Ÿ’‘ ๐Ÿ’’ ๐Ÿ’“ ๐Ÿ’” ๐Ÿ’• ๐Ÿ’– ๐Ÿ’— ๐Ÿ’˜ ๐Ÿ’™ ๐Ÿ’š ๐Ÿ’› ๐Ÿ’œ ๐Ÿ’ ๐Ÿ’ž ๐Ÿ’Ÿ ๐Ÿ’  ๐Ÿ’ก ๐Ÿ’ข ๐Ÿ’ฃ ๐Ÿ’ค ๐Ÿ’ฅ ๐Ÿ’ฆ ๐Ÿ’ง ๐Ÿ’จ ๐Ÿ’ฉ ๐Ÿ’ช ๐Ÿ’ซ ๐Ÿ’ฌ ๐Ÿ’ฎ ๐Ÿ’ฏ ๐Ÿ’ฐ ๐Ÿ’ฑ ๐Ÿ’ฒ ๐Ÿ’ณ ๐Ÿ’ด ๐Ÿ’ต ๐Ÿ’ธ ๐Ÿ’น ๐Ÿ’บ ๐Ÿ’ป ๐Ÿ’ผ ๐Ÿ’ฝ ๐Ÿ’พ ๐Ÿ’ฟ ๐Ÿ“€ ๐Ÿ“ ๐Ÿ“‚ ๐Ÿ“ƒ ๐Ÿ“„ ๐Ÿ“… ๐Ÿ“† ๐Ÿ“‡ ๐Ÿ“ˆ ๐Ÿ“‰ ๐Ÿ“Š ๐Ÿ“‹ ๐Ÿ“Œ ๐Ÿ“ ๐Ÿ“Ž ๐Ÿ“ ๐Ÿ“ ๐Ÿ“‘ ๐Ÿ“’ ๐Ÿ““ ๐Ÿ“” ๐Ÿ“• ๐Ÿ“– ๐Ÿ“— ๐Ÿ“˜ ๐Ÿ“™ ๐Ÿ“š ๐Ÿ“› ๐Ÿ“œ ๐Ÿ“ ๐Ÿ“ž ๐Ÿ“Ÿ ๐Ÿ“  ๐Ÿ“ก ๐Ÿ“ข ๐Ÿ“ฃ ๐Ÿ“ค ๐Ÿ“ฅ ๐Ÿ“ฆ
@rostegg
rostegg / adb-auto-connect
Last active July 31, 2020 19:20
Discover all Android devices throug network with ADB TCP debug mode enabled
#!/bin/bash
# Copy to /usr/bin and don't forget to make the script executable
# Usage: adb-auto-connect <adb_port> ("5555" if empty)
IP_TEMPLATE=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}' | grep -Eo '([0-9]*\.){3}' | grep -v '127.0.0')
NETWORK_IP_WITH_MASK="${IP_TEMPLATE}0/24"
printf "\e[32mStarting scan \e[0m${NETWORK_IP_WITH_MASK}\n"
AVAILABLE_IPS=($(nmap -sn ${NETWORK_IP_WITH_MASK} | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"))
printf '\e[32mAvailable devices in network: \e[0m\n'