Skip to content

Instantly share code, notes, and snippets.

@sirodoht
sirodoht / new-db-postgres.md
Last active July 30, 2021 09:15
How to create new database and new user with password on PostgreSQL (the easiest way)

How to create new database and new user with password on PostgreSQL

First, create db:

$ createdb avocado

Then, create user:

$ createuser avocado
import os
from send2trash import send2trash
# get origin dir
photos_path = r"/Volumes/Leslie/G_processing/alltakeouts"
# index all origin files to a dict[filename] = path
log_filename = "json-files-to-delete.log"
log_file = open(log_filename, "w")
use std::time::Instant;
let before = Instant::now();
workload();
println!("Elapsed time: {:.2?}", before.elapsed());
@sirodoht
sirodoht / dokku-commands.sh
Last active October 31, 2020 16:51
Dokku config commands
# config with restart
dokku config:set mataroa SECRET_KEY=''
# config no restart
dokku config:set --no-restart mataroa EMAIL_HOST_USER=''
dokku config:set --no-restart mataroa EMAIL_HOST_PASSWORD=''
# run command
dokku run mataroa python manage.py createsuperuser --email zf@sirodoht.com --username sirodoht
@sirodoht
sirodoht / lighter.css
Created May 18, 2020 23:39
new.css lite version without fonts and minification https://newcss.net/
:root {
--text-color: #1a1a1a;
--light-grey-color: #f6f8fa;
--grey-color: #e5e7eb;
--link-color: #0070f3;
--link-accent-color: #0366d6;
--light-cyan-color: #79ffe1;
--dark-cyan-color: #0c4047;
}
@sirodoht
sirodoht / index.html
Last active May 13, 2020 18:16
Basic HTML/CSS boilerplate with Normalize.css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello</title>
<link rel="stylesheet" href="main.css">
</head>
<body>

Textmate default settings

Exclude files matching

{*.{o,pyc},Icon\r,CVS,_darcs,_MTN,\{arch\},blib,*\~.nib}

Include files matching

// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+k i",
"command": "workbench.files.action.collapseExplorerFolders"
},
{
"key": "ctrl+down",
"command": "scrollLineDown",
"when": "textInputFocus"
defaults write org.p0deje.Maccy hotKey control+command+c
defaults write org.p0deje.Maccy historySize 50
defaults write org.p0deje.Maccy popupPosition center