Skip to content

Instantly share code, notes, and snippets.

@smeda2205
smeda2205 / AuthenService.java
Created December 4, 2018 09:26 — forked from virasak/AuthenService.java
Simple Guice & JUnit4 Integration: Use the unit test itself as a module to provide member injection. Use @provides methods to build a module from unit test object.
import com.google.inject.Inject;
public class AuthenService {
private final UserDAO userDAO;
@Inject
public AuthenService(UserDAO userDAO) {
this.userDAO = userDAO;

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@smeda2205
smeda2205 / global-variables-are-bad.js
Last active August 29, 2015 14:27 — forked from hallettj/global-variables-are-bad.js
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {