Skip to content

Instantly share code, notes, and snippets.

View paolodina's full-sized avatar
🔋
always on

pdina paolodina

🔋
always on
  • 03:15 (UTC +02:00)
View GitHub Profile
@paolodina
paolodina / +layout.server.ts
Created July 31, 2023 12:42
Access auth info in (every) component
// src/routes/+layout.server.ts
// Ref. https://discord.com/channels/1004048134218981416/1135138484944900156
export const load = ({ locals }) => {
return {
isLoggedIn: locals.isLoggedIn
};
};
@paolodina
paolodina / DB.test.ts
Created March 13, 2023 21:50 — forked from pmuens/DB.test.ts
SQLite as a Graph Database
import DB from './DB'
describe('DB', () => {
let db: DB
const data = { name: 'Tom Cook', type: ['person', 'CEO'] }
beforeEach(() => {
db = new DB()
db.addNode('1', { name: 'Apple Computer Company', type: ['company', 'start-up'], founded: 'April 1, 1976' })
@paolodina
paolodina / gist:29a3c941530b57df80be706a033db4b9
Created September 30, 2022 16:15 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@paolodina
paolodina / dendron-import-github-stars.py
Last active July 2, 2022 16:02
A script to import GitHub stars into Dendron. DRAFT
#!/usr/bin/env python
"""
Obtain the starred data with this:
https://github.com/dogsheep/github-to-sqlite#fetching-repos-that-have-been-starred-by-a-user
"""
import csv
import json
import string
@paolodina
paolodina / bootstrap.sh
Created December 21, 2021 07:59
wip setup
# packages
apt install -y \
wget \
curl \
vim \
tree \
mc \
htop \
make \
build-essential \
@paolodina
paolodina / db_backup.sh
Created May 16, 2020 11:10 — forked from janit/db_backup.sh
Rotating PostgreSQL Backup Script
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
fi
@paolodina
paolodina / next_nginx.md
Created June 16, 2018 06:55 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@paolodina
paolodina / vimrc
Created January 10, 2018 03:09 — forked from michaelfox/vimrc
Basic / Simple vimrc config file
set nocompatible
set encoding=utf-8
set hidden
filetype plugin indent on
syntax on
set synmaxcol=2048 " Don't syntax highlight super-long lines (for performance)
set autoindent " automatically indent lines and try to do it intelligently
set smartindent
set backspace=indent,eol,start " backspace behaves 'normally'
@paolodina
paolodina / git-log-to-tsv.sh
Created July 12, 2017 21:35 — forked from pwenzel/git-log-to-tsv.sh
Git Log to Tab-Delimited CSV File
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
@paolodina
paolodina / gist:59ef468cda1f46882ec5113ed7b0b283
Created January 5, 2017 11:24 — forked from minostro/gist:11387989
Configuring Nginx on Webfaction

1.- Get into the src folder, download & extract nginx source

  • cd ~/src
  • curl -O http://nginx.org/download/nginx-1.7.0.tar.gz
  • tar -xzvf nginx-1.7.0.tar.gz
  • cd nginx-1.7.0

2.- Configuring the source

./configure --prefix=$HOME/local/nginx \