Skip to content

Instantly share code, notes, and snippets.

Jonathan Welzel jnwelzel

Block or report user

Report or block jnwelzel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jnwelzel / certificates.txt
Last active Sep 27, 2018
Client authentication through SSL certificate in JBoss AS 7.1.1.Final. This configuration will make sure that only clients whose certificates are trusted by the server may have access to the application (standalone.xml line 272)
View certificates.txt
SERVER KEYSTORE - used by the server to establish a secure connection (HTTPS)
c:\eclipse\jdk1.7.0_05\jre\bin\keytool.exe -genkey -keyalg RSA -alias localhost -keystore localhost.jks -validity 365 -keysize 2048
CLIENT KEYSTORE - used to generate ".cer" file that wil be used in the server's trustore and in the browser to identify the client with the server
c:\eclipse\jdk1.7.0_05\jre\bin\keytool.exe -genkey -keyalg RSA -alias jonwelzel -keystore jonwelzel.jks -validity 365 -keysize 2048
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/jwelzel/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See
$ mvn archetype:generate -DgroupId=com.jonwelzel.segment2 -DartifactId=segment2 -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
# Description:
# this script restores couchbase & neo4j from the UX reference server, e.g qa1b.
# the process for restoring this is as follows:
# - start Couchbase and stop neo4j (with
# - download the latest backup from
# - run this script as "sudo <DB_ARCHIVE_ZIP> [<CLOUDPASS_HOME_DIR>]"
# - start neo4 (with
# - hit localhost:7474/browser and confirm that DB size is apprx 32gb by clicking the circles in the top-left corner
View new_injection.js
//generate the javascript content of method cloudpassSetUsername to inject into the current page
function injectSetUsernameFunc(usernameFieldIsId,usernameField){
var js = 'window.cloudpassSetUsername = function(username){';
js += 'forceChangeField( document.getElementById("'+usernameField+'"), username);';
js += 'forceChangeField( document.getElementsByName("'+usernameField+'")[0], username);';
js += '};';
return js;
View .bash_profile
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/
export GRAILS_HOME=/home/jwelzel/apps/grails-2.2.4
export IDM_HOME=/home/jwelzel/dev/totvs/identity
export IDM_BIN=$IDM_HOME/backend/build/bin
# Fluig Identity
alias search='cd $IDM_BIN && sh'
alias keystore='cd $IDM_BIN && sh'
View br_phone_regex.js
/^(\(0?\d{2}\)\s?|0?\d{2}[\s.-]?)\d{4,5}[\s.-]?\d{4}$/.test('(47) 9999-9999'); //true
/^(\(0?\d{2}\)\s?|0?\d{2}[\s.-]?)\d{4,5}[\s.-]?\d{4}$/.test('47 9999 9999'); //true
jnwelzel /
Last active Aug 11, 2017
Simple generic DAO structure for Java. Note that the interface takes two generic parameters, one for the primary key type, and the second for the bean type, which uses the same primary key. This enables you to use any kind of object as a primary key, making your code very flexible. This is a good behavior especially if you use JPA embedded ids (…
public abstract class Bean<PK extends Serializable> implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name = "VERSION", nullable = false)
private Long version;
public Bean(PK id, Long version) {
jnwelzel / emoji_cheat_sheet.json
Last active Dec 31, 2016
Emoji cheat sheet
View emoji_cheat_sheet.json
PEOPLE: [":smile:",":laughing:",":blush:",":smiley:",":relaxed:",":smirk:",":heart_eyes:",":kissing_heart:",":kissing_closed_eyes:",":flushed:",":relieved:",":satisfied:",":grin:",":wink:",":stuck_out_tongue_winking_eye:",":stuck_out_tongue_closed_eyes:",":grinning:",":kissing:",":kissing_smiling_eyes:",":stuck_out_tongue:",":sleeping:",":worried:",":frowning:",":anguished:",":open_mouth:",":grimacing:",":confused:",":hushed:",":expressionless:",":unamused:",":sweat_smile:",":sweat:",":disappointed_relieved:",":weary:",":pensive:",":disappointed:",":confounded:",":fearful:",":cold_sweat:",":persevere:",":cry:",":sob:",":joy:",":astonished:",":scream:",":tired_face:",":angry:",":rage:",":triumph:",":sleepy:",":yum:",":mask:",":sunglasses:",":dizzy_face:",":imp:",":smiling_imp:",":neutral_face:",":no_mouth:",":innocent:",":alien:",":yellow_heart:",":blue_heart:",":purple_heart:",":heart:",":green_heart:",":broken_heart:",":heartbeat:",":heartpulse:",":two_hearts:",":revolving_hearts:",":cupid:",":sparkling_
jnwelzel /
Created Mar 10, 2014 — forked from hstaudacher/
Integrating Gson into a JAX-RS application to replace the other shitty default providers
import static;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
You can’t perform that action at this time.