Skip to content

Instantly share code, notes, and snippets.

View bric3's full-sized avatar
💭
🤨

Brice Dutheil bric3

💭
🤨
View GitHub Profile
final Context ctx = vertx.currentContext();
otherLibrary.doSomethingAsync("foo", new Runnable() {
public void run() {
// This will be executed on the other library's thread so we need to make sure the result is done on the correct context
ctx.runOnContext(new Handler<Void>() {
public void handle(Void v) {
// Now we are on the right context - use the Vert.x API as normal
request.response().end("blah");
}
@kubido
kubido / load_jquery
Created November 2, 2011 02:25
load jquery from chrome console, firebug.. etc
script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
document.body.appendChild(script);
@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.

@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<>();
@semenko
semenko / dmidecode
Last active October 26, 2021 02:57
Dell XPS 13 2015 model 9343 on Ubuntu 15.04, dmidecode, lsusb, lspci
$ sudo dmidecode
# dmidecode 2.12
# SMBIOS entry point at 0x000f0000
SMBIOS 2.8 present.
<SNIP>
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@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)
@bric3
bric3 / install_jdk5_post_lion.sh
Last active April 18, 2023 06:50
Automate the install of JDK 5 on Lion, Mountain Lion, Mavericks
# _______ _ _ _ _ _
# |__ __| | (_) (_) | | | |
# | | | |__ _ ___ ___ ___ _ __ _ _ __ | |_ _ __ ___ _____ _____ __| |
# | | | '_ \| / __| / __|/ __| '__| | '_ \| __| | '_ ` _ \ / _ \ \ / / _ \/ _` |
# | | | | | | \__ \ \__ \ (__| | | | |_) | |_ | | | | | | (_) \ V / __/ (_| |
# |_| |_| |_|_|___/ |___/\___|_| |_| .__/ \__| |_| |_| |_|\___/ \_/ \___|\__,_|
# | |
# |_|
#
# New home : https://github.com/bric3/osx-jdk5-installer
@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

@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt