Skip to content

Instantly share code, notes, and snippets.

View aaiezza's full-sized avatar

Alessandro Aiezza aaiezza

View GitHub Profile
@lukaseder
lukaseder / postgis-mandelbrot.sql
Created November 14, 2021 10:03
PostGIS Mandelbrot
with recursive
dims (r1, r2, i1, i2, s, it, p) as (values (-2::float, 1::float, -1.5::float, 1.5::float, 0.01::float, 100, 256.0::float)),
sprites (s) as (values (st_makepolygon(st_geomfromtext('linestring (0 0, 0 1, 1 1, 1 0, 0 0)')))),
n1 (r, i) as (select r, i from dims, generate_series((r1 / s)::int, (r2 / s)::int) r, generate_series((i1 / s)::int, (i2 / s)::int) i),
n2 (r, i) as (select r::float * s::float, i::float * s::float from dims, n1),
l (cr, ci, zr, zi, g, it, p) as (
select r, i, 0::float, 0::float, 0, it, p from n2, dims
union all
select cr, ci, zr*zr - zi*zi + cr, 2 * zr * zi + ci, g + 1, it, p from l where g < it and zr*zr + zi*zi < p
),
@aaiezza
aaiezza / currentversion.sh
Last active April 20, 2020 13:06
Maven Project | Bump Major, Minor, or Patch Sematic Version
currentversion() {
# If xpath is on your machine (macos will I believe),
# and the project's version is in the path `project.version`,
# then it is nice to use this because it is faster.
# xpath ./pom.xml 'project/version/text()' 2>/dev/null
# Otherwise:
mvn help:evaluate -Dexpression=project.version -q -DforceStdout
}
@vdespa
vdespa / writeToDisk.js
Created April 11, 2018 10:44
Newman - Logging request and response body
const newman = require('newman');
newman.run({
collection: require('./postman_collection.json'),
reporters: 'cli'
}).on('beforeRequest', function (error, args) {
if (error) {
console.error(error);
} else {
// Log the request body
@troyfontaine
troyfontaine / 1-setup.md
Last active July 19, 2024 15:08
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@toschneck
toschneck / install_docker_bash_completions.sh
Last active April 2, 2024 12:41
Install Docker and Docker-Compose bash completion
#!/usr/bin/env bash
set -e
echo "install docker bash completion"
curl -L https://raw.githubusercontent.com/docker/docker/v$(docker version --format '{{.Server.Version}}')/contrib/completion/bash/docker -o /etc/bash_completion.d/docker
echo "install docker-compose bash completion"
curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
echo ".... done!"
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName