Skip to content

Instantly share code, notes, and snippets.

@axelbdt
axelbdt / django-postgresql-15.md
Last active April 26, 2024 08:03
# Django and PostgreSQL 15, the rules have changed

Django and PostgreSQL 15, the rules have changed

Postgres 15 is just out, and while there is a lot to love about this new release, you're in for a surprise if you try to set it up with Django following tutorials like this one.

The reason is stated in the release announcement:

Remove PUBLIC creation permission on the public schema (Noah Misch) The new default is one of the secure schema usage patterns that Section 5.9.6 has recommended...

Provided your web app doesn't access your database as a superuser (it shouldn't) and uses a dedicated user, it is not allowed to use the public schema anymore. You have to create one for this specific user, and the next section will

@Konstantinusz
Konstantinusz / magyar-szavak.txt
Created September 22, 2020 15:22
Magyar szavak listája
This file has been truncated, but you can view the full file.
abajgat
abakusz
abál
abált
abaposztó
abárol
abba
abbahagy
abbahagyat
@kjellskogsrud
kjellskogsrud / Empty commits
Created March 26, 2020 15:42
Why empty commits are good
I once read an https://bit-booster.com/doing-git-wrong/2017/01/02/git-init-empty/ , about why
you should start with an empty commit for a new repo. The page has since then dissapperard but I got
some of it out of the wayback machine and archive it here:
Always Start With An Empty Commit
Whenever you start a new git repo, pop an empty commit onto it before you do anything else!
git init new-repo
cd new-repo
git commit -m 'initial empty commit' --allow-empty
@davidak
davidak / gist:171f81f945f36d7fd88dce4e67af8a5d
Created March 21, 2020 08:33
Use older package version with Nix
This works with the package manager [Nix](https://nixos.org/nix/), available on NixOS and working on most linux distros and macOS (theoretically also BSD and Windows).
1. search for package definition on GitHub, for example ansible
https://github.com/NixOS/nixpkgs/search?p=1&q=ansible&unscoped_q=ansible
it is here https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/ansible/default.nix
2. search the history for the last commit with your preferred version, for example 2.5
@mendeza
mendeza / vim-sort-regex.md
Last active October 4, 2022 11:36
Vim Sort with RegEx

Vim Sort with RegEx

Vim Manual

See :help :sort.

:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
@573
573 / iso-config.nix
Last active January 17, 2024 21:32
Using a nixos qemu machine for fun and profit howto, as well creating iso files.
{ pkgs, lib, ... }:
with lib;
{
config = {
i18n.defaultLocale = "de_DE.UTF-8";
time.timeZone = "Europe/Paris";
services = {
@alpgarcia
alpgarcia / github-token-for-git.md
Last active February 5, 2024 11:40
Configure GitHub token with gnome-keyring
  1. git --version
git version 2.17.1
  1. sudo apt-get install libsecret-1-0 libsecret-1-dev
  2. cd /usr/share/doc/git/contrib/credential/libsecret
  3. sudo make
  4. git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
  5. Next time Git asks for your GitHub username and password, just write your username and paste your token and they'll be stored in your keyring.
with import <nixpkgs> {};
let
path = ./mwe;
string = "./mwe";
pathPath = path + /test/file.nix;
pathString = path + "/test/file.nix";
pathStringPath = path + "/test" + /file.nix;
stringPath = string + /test/file.nix;
stringPathWorking = string + /nix/var/nix/db/schema;
@AndersonTorres
AndersonTorres / nix-development-template-file.org
Last active September 27, 2021 21:01
A project workflow for Nixpkgs/NixOS

Standard project structure

This is a project structure I’ve found useful. Looking for any thoughts/comments/feedback. Roughly, I found a tension between the style nixpkgs expects and the style conducive to development, so I extracted the common portion into a derivation.nix which is used by the remaining .nix files. This setup allows me to use nix build, nix-shell, overlays, Hydra, alternate packaging schemes, cross-compiling, etc.

@romainl
romainl / grep.md
Last active April 28, 2024 19:53
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix