Skip to content

Instantly share code, notes, and snippets.

View bric3's full-sized avatar
💭
🤨

Brice Dutheil bric3

💭
🤨
View GitHub Profile
@noraj
noraj / gulp-cjs-to-esm.md
Last active April 19, 2024 14:51
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

@bric3
bric3 / develop-jmc-ij.md
Last active March 20, 2022 23:50
Develop JDK Mission Control within IntelliJ

Opening in IJ

JMC with IntelliJ

At this stage there’s two approach:

  • If you only need to work on the core libraries, then you only need those, and they can be imported as a maven project with some configuration
  • If you need the full blown JMC, then you need the other import approach, that is a mix of .project - .classpath and Maven projects.

Working on the on the core libraries

  1. File | Open… , then select the core folder in the JMC cloned repository,
  2. Trust the project (also tick the Trust projects in <JMC clone path> as well)

I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@jchandra74
jchandra74 / openssl.MD
Last active February 16, 2024 21:23
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@raphw
raphw / WeakeningAgent.java
Last active January 23, 2021 11:40
A Java agent for fixing exports for an app that is not yet Java 9 aware.
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Layer;
import java.lang.reflect.Module;
import java.util.*;
public class WeakeningAgent {
public static void premain(String argument, Instrumentation instrumentation) {
boolean full = argument != null && argument.equals("full");
Set<Module> importing = new HashSet<>(), exporting = new HashSet<>();
@nikhiljha
nikhiljha / AddCookiesInterceptor.java
Created July 29, 2016 04:35
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
// Original written by tsuharesu
// Adapted to create a "drop it in and watch it work" approach by Nikhil Jha.
// Just add your package statement and drop it in the folder with all your other classes.
import android.content.Context;
import android.preference.PreferenceManager;
import android.util.Log;
import java.io.IOException;
import java.util.HashSet;
@danieleggert
danieleggert / GPG and git on macOS.md
Last active April 22, 2024 07:46
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@bric3
bric3 / codebreaker.md
Last active November 1, 2015 13:52
recruitment tests

Codebreaker

Implement a simple program that match the requirements below.

The game

Code breaking is all about finding the secret code.

When the game starts the player should be able to guess the secret code by providing a 4 digits number. The game finishes when the player have found the exact match for the secret code.