Skip to content

Instantly share code, notes, and snippets.

View maciejjankowski's full-sized avatar
🦍
hu!

Maciej Jankowski maciejjankowski

🦍
hu!
View GitHub Profile
@maciejjankowski
maciejjankowski / disable localhost ssl errors.txt
Created July 7, 2021 14:02
disable localhost ssl errors
edge://flags/#allow-insecure-localhost
@maciejjankowski
maciejjankowski / pg_restore.sh
Created March 24, 2021 12:09
Restore pg_dump data
docker cp db_backup_file docker_hash:/tmp/db_backup_file
pg_restore --no-privileges \
--no-owner \
--superuser=postgres \
--disable-triggers \
--clean \
-d db_name \
/tmp/db_backup_file
@maciejjankowski
maciejjankowski / settings.py
Created February 22, 2021 15:50
Logging raw SQL to the console in Django
LOGGING = {
'version': 1,
'filters': {
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue',
}
},
'handlers': {
'console': {
'level': 'DEBUG',
find . -path ./venv -prune -false -o -name '*.py' -exec tail -n +1 {} + > ../output.txt
@maciejjankowski
maciejjankowski / config.txt
Last active January 29, 2022 12:37
raspberry pi waveshare 7 inch lcd display
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt=1024 600 60 6 0 0 0
hdmi_drive=1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
@maciejjankowski
maciejjankowski / bookmarklet.js
Last active May 12, 2020 08:09
github bookmark bookmarklet
const month = new Date().toDateString().split(' ')[1];
const year = new Date().toDateString().split(' ')[3];
if (location.href.indexOf(`github.com/maciejjankowski/${year}/wiki`) > -1) {
const searchToken = '# Worth checking:\n';
const textarea = document.querySelector('#gollum-editor-body');
const textIndex = textarea.value.indexOf(searchToken);
const textLength = searchToken.length;
textarea.value =
textarea.value.slice(0, textIndex + textLength) +
prompt() +
@maciejjankowski
maciejjankowski / bookmarklet.js
Created September 27, 2019 21:05
github bookmarking bookmarklet
const month = new Date().toDateString().split(' ')[1];
const year = new Date().toDateString().split(' ')[3];
if (location.href.indexOf(`github.com/maciejjankowski/${year}/wiki`) > -1) {
const searchToken = '# Worth checking:\n';
const textarea = document.querySelector('#gollum-editor-body');
const textIndex = textarea.value.indexOf(searchToken);
const textLength = searchToken.length;
textarea.value =
textarea.value.slice(0, textIndex + textLength) +
@maciejjankowski
maciejjankowski / microgranny sox convert sample rate.sh
Last active May 15, 2019 21:57
convert sample rate command line sox
for file in *
do
if [ ! -d "$file" ] && [ ! "$file" == 'convert.sh' ] ; then
sox $file -b 16 -c 1 -r 48k "converted/$file"
fi
done