Skip to content

Instantly share code, notes, and snippets.

View Vlasterx's full-sized avatar
🛸
Working from mothership

Vladimir Jovanović Vlasterx

🛸
Working from mothership
  • Open Law Library
  • Belgrade, Serbia
  • 11:33 (UTC +02:00)
View GitHub Profile
@Vlasterx
Vlasterx / generate_signing_keys.md
Last active June 7, 2024 11:54
Creating signing keys for GitHub

Use GPG signing keys for GitHub


Windows only:

@Vlasterx
Vlasterx / auth.py
Created March 26, 2024 10:15
OLL Auth workaround
# Workaround for setting the redirect_uri to localhost.
# Host is set in proxy server.py and redirect_uri takes the request host value
# See https://github.com/openlawlibrary/platform/issues/4281
def get_redirect_uri(self, state=None):
"""Build redirect with redirect_state parameter."""
uri = self.redirect_uri
if self.REDIRECT_STATE and state:
uri = self.url_add_parameters(uri, {"redirect_state": state})
if settings.DEBUG:
return uri.replace('127.0.0.1', 'localhost')
@Vlasterx
Vlasterx / tree-shaking.md
Last active January 23, 2024 11:31
Note for tree shaking

Note for the tree shaking

In order to properly enable tree shaking, each main function whould be written in its own file, exported as default and then additionally exported from the index.ts.

/src/something/some-function.ts

export const someFunction = () => {}

export default someFunction
@Vlasterx
Vlasterx / picard-facepalm-ascii.md
Last active February 9, 2022 18:41 — forked from aim-up/picard-facepalm-ascii.txt
Captain Picard Facepalm ASCII
...........................................________........................
....................................,.-‘”...................``~.,..................
.............................,.-”...................................“-.,............
.........................,/...............................................”:,........
.....................,?......................................................\,.....
.................../...........................................................,}....
................./......................................................,:`^`..}....
.............../...................................................,:”........./.....
..............?.....__.........................................:`.........../.....
@Vlasterx
Vlasterx / uBlock.txt
Last active July 5, 2024 04:37
uBlock konfiguracija
! Reddit clean-up
www.reddit.com##a[href^="/rpan/"] > h3:has-text(/Top (livestream|broadcast)/):upward(7)
! Linkedin clean-up
www.linkedin.com##.feed-shared-actor__description:has-text(/Promoted/):upward(7)
www.linkedin.com##.feed-shared-text-view>span:has-text(/Add to your feed/):upward(7)
! Twitter clean-up
!twitter.com##h2>div>span:has-text(/Trends for you/):upward(10)
!twitter.com##h2>div>span:has-text(/You might like|Who to follow/):upward(5)
@Vlasterx
Vlasterx / delete-linkedin-posts.js
Last active January 19, 2024 18:33
Delete all LinkedIn posts version for June 2021.
(() => {
let speedMs = 500
setInterval(() => {
let dropdown = document.querySelector('.feed-shared-update-v2__control-menu .artdeco-dropdown button')
dropdown.click()
setTimeout(() => {
let optionDel = dropdown.parentElement.parentElement.parentElement.querySelector('.option-delete .tap-target')
@Vlasterx
Vlasterx / table2json.js
Created April 1, 2021 13:11
HTML table to JSON
/**
* Recursive function that parses table elements
*
* @param elHtml - HTML object that contains table
* @returns { Object } JSON element with parsed table
*/
const parseTable = (elHtml = null) => {
if (elHtml === null) { return false }
let elName = String(elHtml.nodeName).toLowerCase()
@Vlasterx
Vlasterx / UnlikeTweets.js
Created July 30, 2020 07:07
Unlike tweets
setInterval(function () {
var divs = document.getElementsByTagName('div')
var arr = Array.prototype.slice.call(divs)
var hearts = arr.filter(x => x.getAttribute('data-testid') == 'unlike')
hearts.forEach(h => h.click())
window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight);
}, 1000);
@Vlasterx
Vlasterx / export-common.js
Created December 25, 2019 14:52
Export/Import reminder
module.exports = (option) => {
console.log('It works!', option)
}
@Vlasterx
Vlasterx / .bash_profile
Created May 31, 2019 16:22
Better bash look (user)
# Paste this into ~/.bash_profile
export PS1="\n\[$(tput sgr0)\]\[\033[38;5;27m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;63m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;6m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;6m\]]\[$(tput sgr0)\]\[\033[38;5;15m\]\n\[$(tput sgr0)\]\[\033[38;5;10m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;8m\]>\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"