Skip to content

Instantly share code, notes, and snippets.

View switchover's full-sized avatar
💭
This, too, shall pass away!

Vincent Han switchover

💭
This, too, shall pass away!
View GitHub Profile
@switchover
switchover / fibonacci.go
Created June 24, 2019 15:49
Closure Example in Go lang
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
a, b := 0, 1
return func() int {
// c := a
@switchover
switchover / ApplicationContextHolder.java
Created May 8, 2019 23:55
[Spring] Utility class example for getting Spring beans using Generic Methods
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class ApplicationContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;