Skip to content

Instantly share code, notes, and snippets.

Sign Jars using Gradle

To sign one or more jar files using the jarsigner tool (part of any JDK), follow these instructions. Notice this set of instructions assume you already have the needed KeyStore with the corresponding Code Signing certificate, the KeyStore and certificate key password, and you know the alias of the Key to use from the KeyStore.

  • Make sure to have a KeysStore with your Code Signing certificate, associated passwords, etc.
  • Add the following properties to your Gradle project. Remember you probably don't want your private credentials in your versioning system:
@gparlakov
gparlakov / delete-stale-branches.sh
Last active July 17, 2023 02:29 — forked from manofearth/delete-stale-branches.sh
Delete Stale Branches
#!/usr/bin/env bash
while getopts "d" opt; do
case $opt in
d) dryRunOpt="--dry-run";;
esac
done
# prune local "cache" of remote branches first:
git fetch --prune origin
# delete merged to master branches:
@magnetikonline
magnetikonline / README.md
Last active December 22, 2023 11:04
Python function to determine if a given IPv4 CIDR "fits" into another.

CIDR fit

Python function to determine if a given IPv4 CIDR fits into another.

How cidr_fit(cidr_a,cidr_b) works:

  • For both CIDR's given:
    • Splits each CIDR into address and prefix size parts.
    • Converts the address part to a 32 bit binary string.
      • Example: 192.168.0.1 becomes 11000000101010000000000000000001.
@DavidWells
DavidWells / netlify.toml
Last active February 7, 2024 08:50
All Netlify.toml & yml values
[Settings]
ID = "Your_Site_ID"
# Settings in the [build] context are global and are applied to all contexts unless otherwise overridden by more specific contexts.
[build]
# This is the directory to change to before starting a build.
base = "project/"
# NOTE: This is where we will look for package.json/.nvmrc/etc, not root.
# This is the directory that you are publishing from (relative to root of your repo)
@guozi
guozi / ExpirationListener.java
Created August 22, 2018 05:36 — forked from jdonee/ExpirationListener.java
Spring Boot 2 + Spring Session 2 + Shiro 1.4 + Redis(Lettuce) Config
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
/**
* Session过期监听
* @author Frank Zeng
*
@opus-x
opus-x / Spotify_Eliminate_Advertisements
Last active May 2, 2024 21:13
Eliminate Spotify Advertisements + Complete Server List
##################################################################################
# ELIMINATE SPOTIFY ADS (VERSION 1.2 - 8.5) - ABANDONED FOR NOW #
##################################################################################
#
# NOTE: SOMETIMES ONLY ANNOUNCEMENT OF AN AD WHILE USING APP VERSION 7.5-7.9?-8.x.
# USING AN OFFICIAL OLDER VERSION SOLVES THIS. TEST IT (APKMIRROR). THIS WILL NOT
# OCCUR USING CHROMECAST / GOOGLE HOME.
#
# COULD NOT SOLVE THE AUDIO AD INRO/OUTRO IN THE APP.
# SUGGESTIONS? WRITE A COMMENT BELOW.
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 15:48
Bash getopt long options with values usage example.

Bash getopt long options with values usage example

#!/bin/bash -e

ARGUMENT_LIST=(
  "arg-one"
  "arg-two"
  "arg-three"
)
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active March 23, 2024 09:04
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables