Skip to content

Instantly share code, notes, and snippets.

@psychocandy
psychocandy / autovivify_hash.rb
Created February 17, 2013 13:57
Autovivification which allows you to nest away and save you a lot of nil? checks.
hash = Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }
hash[:foo]["bar"][:baz] = 13
# => {:foo=>{"bar"=>{:baz=>13}}}
@erez-rabih
erez-rabih / nginx-dashboard.json
Last active August 29, 2015 14:06
Nginx Dashboard For Logstash
{
"title": "Nginx Web",
"services": {
"query": {
"list": {
"0": {
"query": "response:[200 TO 299]",
"alias": "OK",
"color": "#7EB26D",
"id": 0,
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();