Skip to content

Instantly share code, notes, and snippets.

-- implementation of bitwise & operator for the numeric data type
create or replace function numeric_and(leftarg numeric, rightarg numeric) returns numeric as
$$
declare
width int := 32;
modulo bigint := 2 ^ width;
b1 bigint := 0;
b2 bigint := 0;
r numeric := 0;
i integer := 0;
@allfro
allfro / wireguard.sql
Last active June 17, 2024 02:38
Generate wireguard keypairs using pure postgres plpgsql
-- A pure PL/pgSQL implementation of Curve25519
--
-- This module supports both a low-level interface through _raw_curve25519(base_point, secret)
-- and wg_gen_pubkey(secret) that takes a 32-byte block of data as input. It also provides
-- wg_gen_key() function that generates a random 32-byte private key.
--
-- imports gen_random_bytes function
create extension pgcrypto;
version: "3.8"
networks:
backend:
ingress:
volumes:
pgdata:
configs:
@allfro
allfro / 5G CHANGELOG [TOP SECRET]
Created August 25, 2020 01:24
5G CHANGELOG [TOP SECRET]
Changes from 4G:
* Added Backdoor to support homeland operations; password: C0v1d19
* Added support for 5G weaponized bats and weaponized bats in bat cave.
* Created Bat update server
* Created integration with Bill Gates' "vaccine"
* Created integration with nano surveillance toilet paper rolls
* Refined mind control chem trail chemicals

Keybase proof

I hereby claim:

  • I am allfro on github.
  • I am ndouba (https://keybase.io/ndouba) on keybase.
  • I have a public key whose fingerprint is 6126 32A1 BB12 E3F2 E752 8F4C C98A A37F A053 DBAE

To claim this, I am signing this object:

@allfro
allfro / bring_back_windows
Created June 12, 2014 00:29
Bring all out of bounds Mac windows back in bounds
on run {input, parameters}
tell application "Finder"
set _bounds to get bounds of window of desktop
end tell
tell application "System Events"
set ids to (unix id of processes whose name is equal to "java")
repeat with _id in ids
tell (first process whose unix id is equal to _id)
@allfro
allfro / gist:6113740
Created July 30, 2013 15:01
Install prerequisites for latest webkit GTK build
yum install ruby gperf libjpeg-devel libpng-devel libwebp-devel glib2-devel libicu-devel libxml2-devel pango-devel gtk3-devel libXt-devel libsoup-devel libsecret-devel sqlite-devel libxslt-devel geoclue-devel gstreamer1-* gtk2-devel gobject-introspection-devel
@allfro
allfro / osx_tkinter_workaround.py
Created March 26, 2012 03:03 — forked from CodeSturgeon/osx_tkinter_workaround.py
Tkinter activation workaround
#!/usr/bin/env python
## This script demonstrates a workaround for the Tkinter (Tcl/Tk?) activation
## bug under OS X. More on that here:
from easygui import msgbox
from subprocess import Popen
from Tkinter import Tk
## Bring easygui to foreground