Skip to content

Instantly share code, notes, and snippets.

View ragklaat's full-sized avatar

Richard Ilyes ragklaat

  • Budapest, Hungary
View GitHub Profile
@slumbi
slumbi / MethodLogger.java
Last active August 29, 2015 14:07
simple method logger AOP
package fr.aspects;
import org.apache.log4j.Logger;
@Aspect
public class MethodLogger {
Logger logger = Logger.getLogger(MethodLogger.class);
// @Around("execution(* *(..)) && @annotation(Loggable)")
@Around("execution(* *(..))")
@P7h
P7h / ReadPropertiesWithGuava.java
Last active September 5, 2019 16:30
Load a properties file using Guava.
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
import com.google.common.io.ByteSource;
import com.google.common.io.Resources;
/**
* Reads a properties file and print all the key value pairs to the console.
@lleo
lleo / html5-video-streamer.js
Last active September 2, 2020 13:42
This is an enhancement to Gist#1993068 https://gist.github.com/paolorossi/1993068 . I found what was needed to demonstrate a functioning video stream was a HTML file with a <video> tag pointing to the streamer.
#!/usr/bin/env node
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
* Modified from https://gist.github.com/paolorossi/1993068
*/
var http = require('http')
, fs = require('fs')
, util = require('util')
@golonzovsky
golonzovsky / JaxbTest.java
Last active September 9, 2019 11:59
jaxb wrapper example for non-list elements
package com.test.ws;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@vishr
vishr / ProducerConsumer.java
Created December 4, 2011 17:34
Simplest Producer-Consumer
/**
*
*/
package com.qwata.concurrency;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@trevmex
trevmex / bst.js
Created February 11, 2011 05:38
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*