This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# usage: bash ./split_and_gzip.sh file.txt | |
FILE=$1 | |
LINES_PER_FILE=10000000 #10m | |
$(split -l $LINES_PER_FILE -d $FILE ${FILE}.) | |
FILES=${FILE}.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -A arr | |
for zip_file in *.zip; do | |
unzip -q $zip_file && rm $zip_file | |
file=${zip_file%.zip} | |
read cksm _ < <(md5sum "$file") | |
if ((arr[$cksm]++)); then | |
echo "rm $file" | |
rm $file | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function f_sk_date (ts timestamp ) | |
returns integer | |
stable as $$ | |
if not ts: | |
return None | |
return int(str(ts)[0:10].replace('-','')) | |
$$ language plpythonu; | |
create or replace function f_date (ts timestamp) | |
returns date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def clipboard_to_dataframe(): | |
""" | |
Parses tables in the format: | |
| Col1 | Col2 | | |
------------------- | |
| 1111 | abcdefgh | | |
| 2222 | abcdefgj | | |
------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Marked watched videos | |
// @namespace deKexx | |
// @description Mark watched videos on Youtube | |
// @include http://www.youtube.com/watch* | |
// @include https://www.youtube.com/watch* | |
// @connect popo.local | |
// @author Jan Zeiseweis | |
// @version 0.1 | |
// @grant GM_xmlhttpRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
from pathlib import Path | |
from flask import Flask, request | |
app = Flask(__name__) | |
seen_video_ids_path = Path("video_ids.pkl") | |
if seen_video_ids_path.is_file(): | |
with open(str(seen_video_ids_path), 'rb') as dump: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Track Pageview | |
// @namespace deKexx | |
// @description Sends Url to a local server | |
// @include http://www.youtube.com/watch* | |
// @include https://www.youtube.com/watch* | |
// @connect popo.local | |
// @author Jan Zeiseweis | |
// @version 0.1 | |
// @grant GM_xmlhttpRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cProfile | |
from datetime import datetime | |
def profileit(func): | |
def wrapper(*args, **kwargs): | |
datafn = f"{func.__name__}_{datetime.now().strftime('%Y%m%d_%H%M%S_%f')}.profile" | |
prof = cProfile.Profile() | |
retval = prof.runcall(func, *args, **kwargs) | |
prof.dump_stats(datafn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Settings | |
set nohud | |
set nosmoothscroll | |
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
set typelinkhints | |
let searchlimit = 30 | |
let scrollstep = 70 | |
let barposition = "bottom" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Removes old revisions of snaps | |
# CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
LANG=C snap list --all | awk '/disabled/{print $1, $3}' | | |
while read -r snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
done |
OlderNewer