Skip to content

Instantly share code, notes, and snippets.

View aruld's full-sized avatar
🎯
Focusing

Arul Dhesiaseelan aruld

🎯
Focusing
View GitHub Profile
@aruld
aruld / log4j.properties
Last active April 11, 2024 01:25
Must have Time and Size Log4J appender for your application http://aruld.info/must-have-time-and-size-log4j-appender-for-your-application/
log4j.rootLogger=DEBUG,rollingByDate
# logfile is set to be a TimeAndSizeRollingAppender. Keep 100 backup files before rotating and rolling daily, compression set to GZ
log4j.appender.rollingByDate=uk.org.simonsite.log4j.appender.TimeAndSizeRollingAppender
log4j.appender.rollingByDate.File=/logs/app.log
log4j.appender.rollingByDate.RollOnStartup=true
log4j.appender.rollingByDate.DateRollEnforced=true
log4j.appender.rollingByDate.Threshold=DEBUG
log4j.appender.rollingByDate.DatePattern=.yyyy-MM-dd
log4j.appender.rollingByDate.MaxFileSize=10MB
@aruld
aruld / foreachlistset.dart
Created October 19, 2011 18:30
Dart forEach() on a List/Set
main() {
List<String> list = new List<String>();
list.add('one');
list.add('two');
list.add('twelve');
list.forEach((element) => print(element));
Set<String> set = Set.from(list);
set.forEach((element) => print(element));
}
@aruld
aruld / YFact.java
Created October 27, 2012 20:12 — forked from jonbodner/YFact.java
Generic Y Combinator in Java 8 using lambdas
//based on code from http://www.arcfn.com/2009/03/y-combinator-in-arc-and-java.html and the generic version https://gist.github.com/2571928
class YFact {
// T function returning a T
// T -> T
public static interface Func<T> {
T apply(T n);
}
// Higher-order function returning a T function
class TheCompanyProcess {
public static String cleanUpNames(List listOfNames) {
listOfNames
.findAll {it.length() > 1}
.collect {it.capitalize()}
.join(',')
}
}
@aruld
aruld / multiline.dart
Created October 19, 2011 17:26
Dart String interpolation and multi-line Strings
main() {
var user = 'John Doe';
var message = """
$user!
Welcome to Programming Dart!
""";
print(message);
}
@aruld
aruld / foreachmap.dart
Created October 19, 2011 18:29
Dart forEach() on a Map
main() {
Map<String, int> map = {
'one': 1,
'two': 2,
'twelve': 12};
void iterateMapEntry(key, value) {
map[key] = value;
print('$key:$value');//string interpolation in action
}
@aruld
aruld / install.log
Created August 18, 2019 18:16
brew install certbot log on Amazon Linux 2
[ec2-user@mldev ~]$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
==> Installing Ruby to /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 26.9M 100 26.9M 0 0 11.9M 0 0:00:02 0:00:02 --:--:-- 15.4M
==> Installing successful
==> /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby
ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]
==> Add Ruby to your PATH by running:
@aruld
aruld / # certbot - 2019-08-17_21-14-09.txt
Created August 17, 2019 21:28
certbot on 4.14.133-113.112.amzn2.x86_64 - Homebrew build logs
Homebrew build logs for certbot on 4.14.133-113.112.amzn2.x86_64
Build date: 2019-08-17 21:14:09
@aruld
aruld / RideProviderTest.java
Last active August 20, 2018 06:11
Example shows Local variables support for Lambda Parameters in Java 11
import org.jetbrains.annotations.NotNull;
import java.util.Comparator;
import java.util.function.ToLongFunction;
import java.util.stream.Stream;
public class RideProviderTest {
@FunctionalInterface
private interface RideProvider {
@aruld
aruld / RideTest.java
Created January 11, 2018 03:06
Local Variable Type involving lambda
import java.util.Comparator;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;
public class RideTest {
interface RideProvider {
long getFareEstimate(String start_lat, String start_lng, String end_lat, String end_lng, String type);
}