Skip to content

Instantly share code, notes, and snippets.

View ulrich's full-sized avatar
🏠
Working from home

Ulrich VACHON ulrich

🏠
Working from home
View GitHub Profile
@ulrich
ulrich / gist:648908
Created October 27, 2010 12:07
HTML5 canvas example with Sierpiński
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>canvas hello world</title>
<style>
canvas {
margin: 0 auto;
display: block;
padding: 1px;
@ulrich
ulrich / gist:3737910
Created September 17, 2012 15:08
This script tests a simple emberjs application with casperjs.
var casper = require('casper').create({
verbose: true,
logLevel: 'debug',
});
var url = "file:///media/data/projects/personnal/js/ember.js/simple/index.html";
// a callback that ensures the runloop is flushed before an assert is run. Based on gist...
/*casper.test.emberDidRender = function(cbk){
/*
Java 0day 1.7.0_10 decrypted source
Originaly placed on https://damagelab.org/index.php?showtopic=23719&st=0
From Russia with love.
*/
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.security.AccessController;
@ulrich
ulrich / test_navigation_google.js
Created April 7, 2013 16:28
This Gist is a dummy CasperJS test with the grails-casper-plugin configuration .
var casper = require('casper').create();
casper.start('http://www.google.fr/', function () {
this.test.assertTitle('Google', 'google homepage title is the one expected');
this.test.assertExists('form[action="/search"]', 'main form is found');
this.fill('form[action="/search"]', {
q: 'foo'
}, true);
});
@ulrich
ulrich / gist:5520431
Created May 5, 2013 10:30
Select specified email from string in Microsoft Webmail interface.
$('td:contains("mappyfactory@map...")').each(function(e) { $($(this).prev('td').find('input')[0]).attr('checked','checked') } )

Keybase proof

I hereby claim:

  • I am ulrich on github.
  • I am ulrich (https://keybase.io/ulrich) on keybase.
  • I have a public key whose fingerprint is 6727 271C 5710 1BC9 83F6 CEFC FA02 71C9 77DF 729A

To claim this, I am signing this object:

@ulrich
ulrich / check_port.go
Created March 21, 2020 16:45
Return a free port available in a range of provided ports.
package main
import (
"errors"
"fmt"
"net"
"strconv"
)
const (
@ulrich
ulrich / gist:7c7d5c949047c3f7d90b91c2dcba53f3
Last active November 14, 2020 22:12
Setup Minecraft 1.16.2 with Systemd
#!/bin/bash
sudo apt update -y \
&& sudo apt upgrade -y
sudo apt install \
wget \
screen \
default-jdk \
nmap
@ulrich
ulrich / FizzBuzz.java
Created November 13, 2020 16:03
Fizzbuz Java style 1
package tech.ingenico.ah;
import java.util.function.Function;
import java.util.stream.IntStream;
public class FizzBuzz {
public static final Function<Integer, Integer> MODULO_3 = v -> v % 3;
public static final Function<Integer, Integer> MODULO_5 = v -> v % 5;
public static void run(IntStream intStream) {
@ulrich
ulrich / gist:d44b3f0c0b35a2d6a7e87022904e13b4
Created February 16, 2021 13:49
OWASP cheat sheet in Docker
FROM nginx:latest
WORKDIR /tmp
RUN apt-get update && apt-get install -y curl unzip && apt-get clean
RUN curl -fsSL -O https://cheatsheetseries.owasp.org/bundle.zip
RUN unzip bundle.zip && mv site/* /usr/share/nginx/html