This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.milkyway.spendtracker.servlet; | |
import java.beans.*; | |
import java.io.IOException; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Type; | |
import java.util.Map; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Groovy Test Mocking explains. | |
* | |
* A modification of metaClass static method apply to the class inside the JVM. | |
* You run your test with fork mode enabled, each test is isolated from another at the leve of a class or method. | |
* However you can delete the metaClass behavior by | |
* MyClass.metaClass = null | |
* | |
* Must know | |
* - The metaClass method signature is very important. The documentation does not higlight that the method signature must match exactely: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.charset.Charset | |
import java.nio.file.Files | |
import java.nio.file.Path | |
import java.nio.file.StandardOpenOption | |
/** | |
* Simple template parser. | |
* | |
* This parser offer to: | |
* - Replace $variable by the value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.log4j.RollingFileAppender | |
import org.apache.log4j.helpers.CountingQuietWriter | |
import org.apache.log4j.spi.LoggingEvent | |
/** | |
* Interactive file appender | |
* | |
* Provide a capability to append two event message on a single line in a log file. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Experiment | |
{ | |
/** | |
* Experiment algorithm in Groovy | |
* to create union and exclusion, | |
* intersection between map and list. | |
*/ | |
@Test | |
void code() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.milkyway.mongo.json; | |
import com.google.gson.JsonObject; | |
import java.beans.BeanInfo; | |
import java.beans.IntrospectionException; | |
import java.beans.Introspector; | |
import java.beans.PropertyDescriptor; | |
import java.io.Serializable; | |
import java.lang.reflect.InvocationTargetException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* How to add a callback to AngularJS $resource. | |
* | |
* Promises enables to add success and failure callback | |
* after the execution of $resource method. | |
*/ | |
var app = angular.module("application", ['ngResource']); | |
app.factory('$crud', function ($resource) { | |
return $resource('url', {}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test | |
import java.nio.file.FileVisitResult | |
import java.nio.file.Path | |
import java.nio.file.Paths | |
/*** | |
* Bug with directory starting by '.' | |
* | |
* Here is test to reproduce this issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by victor on 1/19/14. | |
*/ | |
var app = angular.module('app', []); | |
app.factory('ChatService', function () { | |
var service = {}; | |
service.connect = function () | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ] | |
then | |
echo "No directory supplied..." | |
fi | |
for f in $*; | |
do | |
echo "Compressing: $f"; |
OlderNewer