Skip to content

Instantly share code, notes, and snippets.

View tole42's full-sized avatar
🎯
Focusing

tole42

🎯
Focusing
View GitHub Profile
@SessionScoped
public class ConversationLocks implements Serializable {
private final ConcurrentHashMap<String, Lock> conversationLocks = new ConcurrentHashMap<>();
public Lock get(String cid) {
ReentrantLock newLock = new ReentrantLock();
Lock alreadyAvailableLock = conversationLocks.putIfAbsent(cid, newLock);
return alreadyAvailableLock == null ? newLock : alreadyAvailableLock;
}
@tole42
tole42 / generate.c
Created March 5, 2019 16:20 — forked from munificent/generate.c
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<property name='localeCountry' value='' />
<property name='localeLanguage' value='' />