Skip to content

Instantly share code, notes, and snippets.

! 2021-12-29 https://139.99.17.109
139.99.17.109###top-banner
139.99.17.109###after-menu-2
! 2021-12-29 https://www.facebook.com
||facebook.com/video/unified_cvc/*$xhr,domain=facebook.com
! 2022-01-06 https://139.99.17.109
139.99.17.109##.post > .custom-html-widget.textwidget > .row
139.99.17.109###middle-banner
@dblevins
dblevins / Dates.java
Last active May 28, 2022 20:02
Works for Java 8 and above. For Java 7 and before, see this legacy version https://gist.github.com/dblevins/03df3cd5eb12f2da05997eef80ac4eca
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
* This pattern has the following benefits:
*
* - Date formats are referenced as a strong type
* - Code completion on patterns
@sualeh
sualeh / how_to_sign_and_release_to_the_central_repository_with_github_actions.md
Last active April 5, 2024 05:55
How to Sign and Release to The Central Repository with GitHub Actions

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback
@larsvilhuber
larsvilhuber / global-libraries.R
Created April 23, 2019 15:43
Install R packages
####################################
# global libraries used everywhere #
####################################
# Package lock in - optional
MRAN.snapshot <- "2019-01-01"
options(repos = c(CRAN = paste0("https://mran.revolutionanalytics.com/snapshot/",MRAN.snapshot)))
pkgTest <- function(x)
{
if (!require(x,character.only = TRUE))
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active May 9, 2024 21:52
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian =================================

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

@ribasco
ribasco / how-to-install-java-on-raspbian.md
Last active March 27, 2021 18:37
How to install the latest java version in Raspbian (Stretch)

Introduction

The default version of java provided in the latest raspbian images are outdated, so we are going to install from the ppa:webupd8team/java repository instead. Please note that add-apt-repository ppa:webupd8team/java will not work, so we will need to add the repository manually.

Installation

  1. Create the gpg key file and paste the following lines of text below
nano key.txt
@drmalex07
drmalex07 / convertUuidToBigInteger.java
Last active May 1, 2024 21:29
Convert a UUID to an unsigned BigInteger #java #UUID #BigInteger
public static final BigInteger B = BigInteger.ONE.shiftLeft(64); // 2^64
public static final BigInteger L = BigInteger.valueOf(Long.MAX_VALUE);
public static BigInteger convertToBigInteger(UUID id)
{
BigInteger lo = BigInteger.valueOf(id.getLeastSignificantBits());
BigInteger hi = BigInteger.valueOf(id.getMostSignificantBits());
// If any of lo/hi parts is negative interpret as unsigned
@philipjewell
philipjewell / photobucket_bulk_download.md
Last active March 29, 2023 00:23
Download all your photobucket images in bulk via CLI

backstory

On Jul 4, 2017 theverge.com posted an article about photobucket (silently) no longer allowing their users to source their images on 3rd party websites for free, thus leaving websites all over the web broken displaying the following image in replace:

Me being one of those individual, I attempted to go into my photobucket account and download my content as I now have my own hosting I am able to store those images on; however, the only ways to bulk download (on desktop) is by downloading albums through their interface. Doing so, gave me the following error message: "Hmmm. Something didn't click. Want to give it another shot? Try again now."

Doing this serveral times, in different browsers (chrome, firefox and safari), after disabling all my addons and extensions (including ad blockers), it still didn't work.

At this point, doing anything on their website w

@wesleyegberto
wesleyegberto / web.xml
Created March 7, 2017 22:29
web.xml for Servlet 3.1
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
@Rob--W
Rob--W / escaopeHTMLTag.js
Created November 14, 2016 16:39
Example of safe HTML escaping using template literals
/* Example:
var someUnsafeStr = '<img>';
var result = escapeHTMLTag`<input value="${someUnsafeStr}">`;
console.log(result); // <input value="&lt;img&gt;">
// Questions? rob {at} robwu.nl
// */
function escapeHTML(str) {
// Note: string cast using String; may throw if `str` is non-serializable, e.g. a Symbol.