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 / DebugAndroidThroughTCP.md
Created October 9, 2019 23:40
Debug android device through TCP (root device required)
  1. Install terminal on android device (something like 'termux')

  2. From terminal:

$: su
$: setprop service.adb.tcp.port 5555
$: adb tcpip 5555
  1. Go to desktop (or dev machine). Find available devices through network:
@rostegg
rostegg / parseJsFunctionsAsObjectFromString.js
Last active October 10, 2019 16:37
Get all JS functions which declarated as objects from string using single regex
/*
Return array, which contains match arrays
Groups:
[0] - whole function
[1] - function name
[2] - function signature (function(){} or ()=>{})
[3] - function parameters (if declarated as function())
[4] - function parameters (if declarated as ()=>)
[5] - function body (without brackets)
Or use named groups (?<groupName>...) if ES2018
@rostegg
rostegg / parseJsFunctionsFromString.js
Last active October 10, 2019 16:37
Get all JS functions from string using single regex
/*
Return array, which contains match arrays
Groups:
[0] - whole function
[1] - function name
[2] - function parameters string
[3] - function body (excluding brackets)
Or use named groups (?<groupName>...) if ES2018
*/
const definedJsFunctionsRegex = /function\s*([A-z0-9]+)?\s*\(([^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*\)\s*\{((?:[^}{]+|\{[^}{]*\}|[^}]|\}(\"|\'|\`))*)*\}/g;
@rostegg
rostegg / pull-unrelated
Created September 24, 2019 15:53
Pull from remote repository with allowed unrelated history
#!/bin/bash
# Copy to /usr/bin and don't forget to make the script executable
# Usage: pull-unrelated <url> (or origin if not specified)
REPO_URL=$1
if [ -z "$REPO_URL" ]
then
REPO_URL="origin"
@rostegg
rostegg / emoji-array.sh
Last active June 17, 2020 19:47
Unicode emoji characters array for bash
BASE_EMOJIS=(๐Ÿ˜บ ๐Ÿ˜ธ ๐Ÿ˜น ๐Ÿ˜ป ๐Ÿ˜ผ ๐Ÿ˜ฝ ๐Ÿ™€ ๐Ÿ˜ฟ ๐Ÿ˜พ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜ฑ ๐Ÿ‘‰ ๐Ÿ™Œ ๐Ÿป ๐Ÿ”ฅ ๐ŸŒˆ โ˜€ ๐ŸŽˆ ๐ŸŒน ๐Ÿ’„ ๐ŸŽ€ โšฝ ๐ŸŽพ ๐Ÿ ๐Ÿ˜ก ๐Ÿ‘ฟ ๐Ÿป ๐Ÿถ ๐Ÿฌ ๐ŸŸ ๐Ÿ€ ๐Ÿ‘€ ๐Ÿš— ๐ŸŽ ๐Ÿ’ ๐Ÿ’™ ๐Ÿ‘Œ โค ๐Ÿ˜ ๐Ÿ˜‰ ๐Ÿ˜“ ๐Ÿ˜ณ ๐Ÿ’ช ๐Ÿ’ฉ ๐Ÿธ ๐Ÿ”‘ ๐Ÿ’– ๐ŸŒŸ ๐ŸŽ‰ ๐ŸŒบ ๐ŸŽถ ๐Ÿ‘  ๐Ÿˆ โšพ ๐Ÿ† ๐Ÿ‘ฝ ๐Ÿ’€ ๐Ÿต ๐Ÿฎ ๐Ÿฉ ๐ŸŽ ๐Ÿ’ฃ ๐Ÿ‘ƒ ๐Ÿ‘‚ ๐Ÿ“ ๐Ÿ’˜ ๐Ÿ’œ ๐Ÿ‘Š ๐Ÿ’‹ ๐Ÿ˜˜ ๐Ÿ˜œ ๐Ÿ˜ต ๐Ÿ™ ๐Ÿ‘‹ ๐Ÿšฝ ๐Ÿ’ƒ ๐Ÿ’Ž ๐Ÿš€ ๐ŸŒ™ ๐ŸŽ โ›„ ๐ŸŒŠ โ›ต ๐Ÿ€ ๐ŸŽฑ ๐Ÿ’ฐ ๐Ÿ‘ถ ๐Ÿ‘ธ ๐Ÿฐ ๐Ÿท ๐Ÿ ๐Ÿซ ๐Ÿ”ซ ๐Ÿ‘„ ๐Ÿšฒ ๐Ÿ‰ ๐Ÿ’› ๐Ÿ’š)
EXTENDED_EMOJIS=(โ™ˆ โ™‰ โ™Š โ™‹ โ™Œ โ™ โ™Ž โ™ โ™ โ™‘ โ™’ โ™“ โ™  โ™ฃ โ™ฅ โ™ฆ โ™จ โ™ป โ™ฟ โš“ โš  โšก โšช โšซ โšฝ โšพ โ›„ โ›… โ›Ž โ›” โ›ช โ›ฒ โ›ณ โ›ต โ›บ โ›ฝ โœ‚ โœ… โœˆ โœ‰ โœŠ โœ‹ โœŒ โœ โœ’ โœ” โœ– โœจ โœณ โœด โ„ โ‡ โŒ โŽ โ“ โ” โ• โ— โค โž• โž– โž— โžก โžฐ โคด โคต โฌ… โฌ† โฌ‡ โฌ› โฌœ โญ โญ• ใ€ฐ ใ€ฝ ใŠ— ใŠ™ ๐Ÿ€„ ๐Ÿƒ ๐Ÿ…ฐ ๐Ÿ…ฑ ๐Ÿ…พ ๐Ÿ…ฟ ๐Ÿ†Ž ๐Ÿ†‘ ๐Ÿ†’ ๐Ÿ†“ ๐Ÿ†” ๐Ÿ†• ๐Ÿ†– ๐Ÿ†— ๐Ÿ†˜ ๐Ÿ†™ ๐Ÿ†š ๐Ÿ‡จ ๐Ÿ‡ณ ๐Ÿ‡ฉ ๐Ÿ‡ช ๐Ÿ‡ช ๐Ÿ‡ธ ๐Ÿ‡ซ ๐Ÿ‡ท ๐Ÿ‡ฌ ๐Ÿ‡ง ๐Ÿ‡ฎ ๐Ÿ‡น ๐Ÿ‡ฏ ๐Ÿ‡ต ๐Ÿ‡ฐ ๐Ÿ‡ท ๐Ÿ‡ท ๐Ÿ‡บ ๐Ÿ‡บ ๐Ÿ‡ธ ๐Ÿˆ ๐Ÿˆ‚ ๐Ÿˆš ๐Ÿˆฏ ๐Ÿˆฒ ๐Ÿˆณ ๐Ÿˆด ๐Ÿˆต ๐Ÿˆถ ๐Ÿˆท ๐Ÿˆธ ๐Ÿˆน ๐Ÿˆบ ๐Ÿ‰ ๐Ÿ‰‘ ๐ŸŒ€ ๐ŸŒ ๐ŸŒ‚ ๐ŸŒƒ ๐ŸŒ„ ๐ŸŒ… ๐ŸŒ† ๐ŸŒ‡ ๐ŸŒˆ ๐ŸŒ‰ ๐ŸŒŠ ๐ŸŒ‹ ๐ŸŒŒ ๐ŸŒ ๐ŸŒ‘ ๐ŸŒ“ ๐ŸŒ” ๐ŸŒ• ๐ŸŒ™ ๐ŸŒ› ๐ŸŒŸ ๐ŸŒ  ๐ŸŒฐ ๐ŸŒฑ ๐ŸŒด ๐ŸŒต ๐ŸŒท ๐ŸŒธ ๐ŸŒน ๐ŸŒบ ๐ŸŒป ๐ŸŒผ ๐ŸŒฝ ๐ŸŒพ ๐ŸŒฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ„ ๐Ÿ… ๐Ÿ† ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ“ ๐Ÿ” ๐Ÿ• ๐Ÿ– ๐Ÿ— ๐Ÿ˜ ๐Ÿ™ ๐Ÿš ๐Ÿ› ๐Ÿœ ๐Ÿ ๐Ÿž ๐ŸŸ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿค ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿช ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐Ÿฑ ๐Ÿฒ ๐Ÿณ ๐Ÿด ๐Ÿต ๐Ÿถ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ ๐Ÿป ๐ŸŽ€ ๐ŸŽ ๐ŸŽ‚ ๐ŸŽƒ ๐ŸŽ„ ๐ŸŽ… ๐ŸŽ† ๐ŸŽ‡ ๐ŸŽˆ ๐ŸŽ‰ ๐ŸŽŠ ๐ŸŽ‹ ๐ŸŽŒ ๐ŸŽ ๐ŸŽŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ‘ ๐ŸŽ’ ๐ŸŽ“ ๐ŸŽ  ๐ŸŽก ๐ŸŽข ๐ŸŽฃ ๐ŸŽค ๐ŸŽฅ ๐ŸŽฆ ๐ŸŽง ๐ŸŽจ ๐ŸŽฉ ๐ŸŽช ๐ŸŽซ ๐ŸŽฌ ๐ŸŽญ ๐ŸŽฎ ๐ŸŽฏ ๐ŸŽฐ ๐ŸŽฑ ๐ŸŽฒ ๐ŸŽณ ๐ŸŽด ๐ŸŽต ๐ŸŽถ ๐ŸŽท ๐ŸŽธ ๐ŸŽน ๐ŸŽบ ๐ŸŽป ๐ŸŽผ ๐ŸŽฝ ๐ŸŽพ ๐ŸŽฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ„ ๐Ÿ† ๐Ÿˆ ๐ŸŠ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿช ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ” ๐Ÿ— ๐Ÿ˜ ๐Ÿ™ ๐Ÿš ๐Ÿ› ๐Ÿœ ๐Ÿ ๐Ÿž ๐ŸŸ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿค ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐Ÿฑ ๐Ÿฒ ๐Ÿณ ๐Ÿด ๐Ÿต ๐Ÿถ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ ๐Ÿป ๐Ÿผ ๐Ÿฝ ๐Ÿพ ๐Ÿ‘€ ๐Ÿ‘‚ ๐Ÿ‘ƒ ๐Ÿ‘„ ๐Ÿ‘… ๐Ÿ‘† ๐Ÿ‘‡ ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ‘Š ๐Ÿ‘‹ ๐Ÿ‘Œ ๐Ÿ‘ ๐Ÿ‘Ž ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘‘ ๐Ÿ‘’ ๐Ÿ‘“ ๐Ÿ‘” ๐Ÿ‘• ๐Ÿ‘– ๐Ÿ‘— ๐Ÿ‘˜ ๐Ÿ‘™ ๐Ÿ‘š ๐Ÿ‘› ๐Ÿ‘œ ๐Ÿ‘ ๐Ÿ‘ž ๐Ÿ‘Ÿ ๐Ÿ‘  ๐Ÿ‘ก ๐Ÿ‘ข ๐Ÿ‘ฃ ๐Ÿ‘ค ๐Ÿ‘ฆ ๐Ÿ‘ง ๐Ÿ‘จ ๐Ÿ‘ฉ ๐Ÿ‘ช ๐Ÿ‘ซ ๐Ÿ‘ฎ ๐Ÿ‘ฏ ๐Ÿ‘ฐ ๐Ÿ‘ฑ ๐Ÿ‘ฒ ๐Ÿ‘ณ ๐Ÿ‘ด ๐Ÿ‘ต ๐Ÿ‘ถ ๐Ÿ‘ท
@rostegg
rostegg / youtube-top-bar-button.js
Last active October 19, 2019 22:17
This code allow to add custom button to top right panel on youtube (useful for coding webextensions)
/* Just change 'id' field of first <div> */
const svgIcon = 'some svg icon string (24x24 pt)';
const extensionButtonTemplate = `
<div id="extension-button-container" class="style-scope ytd-masthead style-default" new-subscribe-color="" is-icon-button="" has-no-text="" style="width: 40px;">
<div id="button" class="style-scope ytd-topbar-menu-button-renderer" style="margin-top: 4px;">
<a class="yt-simple-endpoint style-scope ytd-topbar-menu-button-renderer" tabindex="-1">
<div="button" class="style-scope ytd-topbar-menu-button-renderer style-default">
<button id="button" class="style-scope yt-icon-button">
<div class="style-scope ytd-topbar-menu-button-renderer">
${svgIcon}
@rostegg
rostegg / rnd-commit
Last active October 21, 2019 16:24
Git commit with random emoji message
#!/bin/bash
# Copy to /usr/bin and don't forget to make the script executable
# Usage: rnd-commit
EMOJIS=(โ™ˆ โ™‰ โ™Š โ™‹ โ™Œ โ™ โ™Ž โ™ โ™ โ™‘ โ™’ โ™“ โ™  โ™ฃ โ™ฅ โ™ฆ โ™จ โ™ป โ™ฟ โš“ โš  โšก โšช โšซ โšฝ โšพ โ›„ โ›… โ›Ž โ›” โ›ช โ›ฒ โ›ณ โ›ต โ›บ โ›ฝ โœ‚ โœ… โœˆ โœ‰ โœŠ โœ‹ โœŒ โœ โœ’ โœ” โœ– โœจ โœณ โœด โ„ โ‡ โŒ โŽ โ“ โ” โ• โ— โค โž• โž– โž— โžก โžฐ โคด โคต โฌ… โฌ† โฌ‡ โฌ› โฌœ โญ โญ• ใ€ฐ ใ€ฝ ใŠ— ใŠ™ ๐Ÿ€„ ๐Ÿƒ ๐Ÿ…ฐ ๐Ÿ…ฑ ๐Ÿ…พ ๐Ÿ…ฟ ๐Ÿ†Ž ๐Ÿ†‘ ๐Ÿ†’ ๐Ÿ†“ ๐Ÿ†” ๐Ÿ†• ๐Ÿ†– ๐Ÿ†— ๐Ÿ†˜ ๐Ÿ†™ ๐Ÿ†š ๐Ÿ‡จ ๐Ÿ‡ณ ๐Ÿ‡ฉ ๐Ÿ‡ช ๐Ÿ‡ช ๐Ÿ‡ธ ๐Ÿ‡ซ ๐Ÿ‡ท ๐Ÿ‡ฌ ๐Ÿ‡ง ๐Ÿ‡ฎ ๐Ÿ‡น ๐Ÿ‡ฏ ๐Ÿ‡ต ๐Ÿ‡ฐ ๐Ÿ‡ท ๐Ÿ‡ท ๐Ÿ‡บ ๐Ÿ‡บ ๐Ÿ‡ธ ๐Ÿˆ ๐Ÿˆ‚ ๐Ÿˆš ๐Ÿˆฏ ๐Ÿˆฒ ๐Ÿˆณ ๐Ÿˆด ๐Ÿˆต ๐Ÿˆถ ๐Ÿˆท ๐Ÿˆธ ๐Ÿˆน ๐Ÿˆบ ๐Ÿ‰ ๐Ÿ‰‘ ๐ŸŒ€ ๐ŸŒ ๐ŸŒ‚ ๐ŸŒƒ ๐ŸŒ„ ๐ŸŒ… ๐ŸŒ† ๐ŸŒ‡ ๐ŸŒˆ ๐ŸŒ‰ ๐ŸŒŠ ๐ŸŒ‹ ๐ŸŒŒ ๐ŸŒ ๐ŸŒ‘ ๐ŸŒ“ ๐ŸŒ” ๐ŸŒ• ๐ŸŒ™ ๐ŸŒ› ๐ŸŒŸ ๐ŸŒ  ๐ŸŒฐ ๐ŸŒฑ ๐ŸŒด ๐ŸŒต ๐ŸŒท ๐ŸŒธ ๐ŸŒน ๐ŸŒบ ๐ŸŒป ๐ŸŒผ ๐ŸŒฝ ๐ŸŒพ ๐ŸŒฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ„ ๐Ÿ… ๐Ÿ† ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ“ ๐Ÿ” ๐Ÿ• ๐Ÿ– ๐Ÿ— ๐Ÿ˜ ๐Ÿ™ ๐Ÿš ๐Ÿ› ๐Ÿœ ๐Ÿ ๐Ÿž ๐ŸŸ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿค ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿช ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐Ÿฑ ๐Ÿฒ ๐Ÿณ ๐Ÿด ๐Ÿต ๐Ÿถ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ ๐Ÿป ๐ŸŽ€ ๐ŸŽ ๐ŸŽ‚ ๐ŸŽƒ ๐ŸŽ„ ๐ŸŽ… ๐ŸŽ† ๐ŸŽ‡ ๐ŸŽˆ ๐ŸŽ‰ ๐ŸŽŠ ๐ŸŽ‹ ๐ŸŽŒ ๐ŸŽ ๐ŸŽŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ‘ ๐ŸŽ’ ๐ŸŽ“ ๐ŸŽ  ๐ŸŽก ๐ŸŽข ๐ŸŽฃ ๐ŸŽค ๐ŸŽฅ ๐ŸŽฆ ๐ŸŽง ๐ŸŽจ ๐ŸŽฉ ๐ŸŽช ๐ŸŽซ ๐ŸŽฌ ๐ŸŽญ ๐ŸŽฎ ๐ŸŽฏ ๐ŸŽฐ ๐ŸŽฑ ๐ŸŽฒ ๐ŸŽณ ๐ŸŽด ๐ŸŽต ๐ŸŽถ ๐ŸŽท ๐ŸŽธ ๐ŸŽน ๐ŸŽบ ๐ŸŽป ๐ŸŽผ ๐ŸŽฝ ๐ŸŽพ ๐ŸŽฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ„ ๐Ÿ† ๐Ÿˆ ๐ŸŠ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿช ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ” ๐Ÿ— ๐Ÿ˜ ๐Ÿ™ ๐Ÿš ๐Ÿ› ๐Ÿœ ๐Ÿ ๐Ÿž ๐ŸŸ ๐Ÿ  ๐Ÿก ๐Ÿข ๐Ÿฃ ๐Ÿค ๐Ÿฅ ๐Ÿฆ ๐Ÿง ๐Ÿจ ๐Ÿฉ ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿฏ ๐Ÿฐ ๐Ÿฑ ๐Ÿฒ ๐Ÿณ ๐Ÿด ๐Ÿต ๐Ÿถ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ ๐Ÿป ๐Ÿผ ๐Ÿฝ ๐Ÿพ ๐Ÿ‘€ ๐Ÿ‘‚ ๐Ÿ‘ƒ ๐Ÿ‘„ ๐Ÿ‘… ๐Ÿ‘† ๐Ÿ‘‡ ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ‘Š ๐Ÿ‘‹ ๐Ÿ‘Œ ๐Ÿ‘ ๐Ÿ‘Ž ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘‘ ๐Ÿ‘’ ๐Ÿ‘“ ๐Ÿ‘” ๐Ÿ‘• ๐Ÿ‘– ๐Ÿ‘— ๐Ÿ‘˜ ๐Ÿ‘™ ๐Ÿ‘š ๐Ÿ‘› ๐Ÿ‘œ ๐Ÿ‘ ๐Ÿ‘ž ๐Ÿ‘Ÿ ๐Ÿ‘  ๐Ÿ‘ก ๐Ÿ‘ข ๐Ÿ‘ฃ ๐Ÿ‘ค ๐Ÿ‘ฆ ๐Ÿ‘ง ๐Ÿ‘จ ๐Ÿ‘ฉ ๐Ÿ‘ช ๐Ÿ‘ซ ๐Ÿ‘ฎ ๐Ÿ‘ฏ ๐Ÿ‘ฐ ๐Ÿ‘ฑ ๐Ÿ‘ฒ ๐Ÿ‘ณ ๐Ÿ‘ด ๐Ÿ‘ต ๐Ÿ‘ถ ๐Ÿ‘ท ๐Ÿ‘ธ ๐Ÿ‘น ๐Ÿ‘บ ๐Ÿ‘ป ๐Ÿ‘ผ ๐Ÿ‘ฝ ๐Ÿ‘พ ๐Ÿค– ๐Ÿ‘ฟ ๐Ÿ’€ ๐Ÿ’ ๐Ÿ’‚ ๐Ÿ’ƒ ๐Ÿ’„ ๐Ÿ’… ๐Ÿ’† ๐Ÿ’‡ ๐Ÿ’ˆ ๐Ÿ’‰ ๐Ÿ’Š ๐Ÿ’‹ ๐Ÿ’Œ ๐Ÿ’ ๐Ÿ’Ž ๐Ÿ’ ๐Ÿ’ ๐Ÿ’‘ ๐Ÿ’’ ๐Ÿ’“ ๐Ÿ’” ๐Ÿ’• ๐Ÿ’– ๐Ÿ’— ๐Ÿ’˜ ๐Ÿ’™ ๐Ÿ’š ๐Ÿ’› ๐Ÿ’œ ๐Ÿ’ ๐Ÿ’ž ๐Ÿ’Ÿ ๐Ÿ’  ๐Ÿ’ก ๐Ÿ’ข ๐Ÿ’ฃ ๐Ÿ’ค ๐Ÿ’ฅ ๐Ÿ’ฆ ๐Ÿ’ง ๐Ÿ’จ ๐Ÿ’ฉ ๐Ÿ’ช ๐Ÿ’ซ ๐Ÿ’ฌ ๐Ÿ’ฎ ๐Ÿ’ฏ ๐Ÿ’ฐ ๐Ÿ’ฑ ๐Ÿ’ฒ ๐Ÿ’ณ ๐Ÿ’ด
@rostegg
rostegg / pdf-from-images.py
Created June 15, 2019 20:02
Build PDF from images
from fpdf import FPDF
from PIL import Image
PATH = 'images/'
files = [PATH + f for f in listdir(PATH) if isfile(join(PATH, f))]
# format - widt&heigh of images
pdf = FPDF(unit="pt", format=[1600, 2400])
for f in files:
@rostegg
rostegg / remove-watermark.py
Created June 15, 2019 19:58
Remove watermark from image
import cv2
img = cv2.imread("in.jpg", 0)
(thresh, img_dark) = cv2.threshold(img, 128, 255,cv2.THRESH_BINARY|cv2.THRESH_OTSU)
img_dark = 255 - img_dark
img_no_watermark = 255 - img_dark
cv2.imwrite("out.jpg", img_no_watermark)
@rostegg
rostegg / ext-debug
Created May 8, 2019 20:25
Just alias for display journal for gnome shell
#!/bin/bash
# Copy to /usr/bin and don't forget to make the script executable
journalctl /usr/bin/gnome-shell -f