Skip to content

Instantly share code, notes, and snippets.

import shelve
from pathlib import Path
from flask import Flask, has_app_context
class ShelveDB:
"""
Use shelve as simple DB. Supports flask.
@frainfreeze
frainfreeze / gitarchive.sh
Last active July 11, 2023 23:32
Merge github repos, preserving history
# before running the script prepare archhive folder in the same location
export REPONAME={HelloWorldRepo}
export GHUSER={UsersUsername}
git clone git@github.com:$GHUSER/$REPONAME.git
cd $REPONAME
git filter-repo --to-subdirectory-filter $REPONAME
cd ../archive
git remote add $REPONAME ../$REPONAME
git fetch $REPONAME --tags
#!/usr/bin/python3
__author__ = "Tomislav Kucar"
__email__ = "kucar.tomislav@gmail.com"
__status__ = "Prototype"
"""Excel sheet to database table extractor
This script allows the user to extract data from excel sheet,
transform it and load it into a database table.

If you have python and curl you can extract tag and its contents out of html file curl -s http://www.google.com/ | python3 -c 'import sys; s=sys.stdin.read(); e=""; print(s[s.find(e)+len(e):s.find("")])'

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Deleting your complete discord dm history

This was tested only on Debian 9. You need python3 and curl in your path.

Process is relativly straightforward. Change the user, chan, and limit in the script bellow. Open discord in Firefox, open network tools, refresh page and find following request Right click on it and copy as curl, paste into get_msg without first part slightly changed that is alredy there. Now delete one of your messages and do same for delete request in return os.system...

This was written for debian 9. Download debian amd64 here

instalation

Using graphical install:

- install lang: english, 
- location: other->europe->croatia,
- locale: en_US,
- keymap: /
Lvl 0 Lvl 1 Lvl 2 Lvl 3 Computer Science
[ ] [ ] [ ] [ ] data structures
[ ] [ ] [ ] [ ] algorithms
[ ] [ ] [ ] [ ] systems programming
Lvl 0 Lvl 1 Lvl 2 Lvl 3 Software Engineering
[ ] [ ] [ ] [ ] source code version control
[ ] [ ] [ ] [ ] build automation

"Note that the knowledge for each level is cumulative; being at level n implies that you also know everything from the levels lower than n."

| Computer Science | Level 0 O(2^n) | Level 1 O(n^2) | Level 2 O(n) | Level 3 O(log n)

This was written for debian 9.
download debian https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
## instalation
Using graphical install:
- install lang: english,
- location: other->europe->croatia,
- locale: en_US,
- keymap: croatian
- hostname, domain: default