Skip to content

Instantly share code, notes, and snippets.

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

willie wulinjie122

🏠
Working from home
  • Shanghai. China
View GitHub Profile
@kennytv
kennytv / BBCodeConverter.java
Last active December 19, 2023 06:10
Simple BBCode -> Markdown converter written in Java
package eu.kennytv;
import java.util.HashMap;
import java.util.Map;
/**
* @author KennyTV on 07.10.2020
*/
public class BBCodeConverter {
@hackjutsu
hackjutsu / TmpDirExample.java
Last active June 7, 2020 00:37
Use java.io.tmpdir to get system tmp directory.
import java.io.File;
import java.io.IOException;
public class TmpDirExample {
public static void main(String[] args) {
String tmpdir = System.getProperty("java.io.tmpdir");
System.out.println("The default value of the java.io.tmpdir system property is: \""
+ tmpdir + "\"\n");
@monzou
monzou / Bootstrap.java
Created December 30, 2014 04:28
Embedded Tomcat 7
package bootstrap;
public final class Bootstrap {
public static void main(String[] args) {
new TomcatServer("../project/module").boot(8080);
}
private Bootstrap() {}
@alexhawkins
alexhawkins / HashTable.js
Last active August 7, 2021 23:33
Correct Implementation of a Hash Table in JavaScript
var HashTable = function() {
this._storage = [];
this._count = 0;
this._limit = 8;
}
HashTable.prototype.insert = function(key, value) {
//create an index for our storage location by passing it through our hashing function
var index = this.hashFunc(key, this._limit);
@arnobroekhof
arnobroekhof / pre-commit
Last active May 9, 2022 13:41
Maven pre commit hook
#!/bin/bash
# save the file as <git_directory>/.git/hooks/pre-commit
echo "Running Maven clean test for errors"
# retrieving current working directory
CWD=`pwd`
MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# go to main project dir
cd $MAIN_DIR/../../