Skip to content

Instantly share code, notes, and snippets.

View Pozo's full-sized avatar

Zoltan Polgar Pozo

View GitHub Profile
fun lazyMap() {
val map = mutableMapOf("aaa" to mutableListOf(32))
map.putIfAbsent("aaa", mutableListOf(2))?.add(2)
println(map)
}
static void lazyMap() {
Map<String, List<Integer>> map = new HashMap<>();
final ArrayList<Integer> integers = new ArrayList<>();
integers.add(32);
map.put("aaa", integers);
final String key = "aaa";
final int value = 2;
if (!map.containsKey(key)) {
@Pozo
Pozo / gist:b1ab957adb2c54c55e22
Created January 19, 2016 14:03
List files in a path which having wildcards with Java1.6
public class App {
private static final String PATTERN = "D:\\maven-repository\\commons-cli\\commons-cli\\1.0\\commons-cli-.*.jar";
public static void main(String[] args) {
List<File> matches = new ArrayList<File>();
String[] pieces = PATTERN.split("\\.\\*");
if(pieces.length >= 2) {
File rootFile = getRootFile(pieces[0]);
String remainingPath = PATTERN.substring(rootFile.getPath().length()+1, PATTERN.length());
@Pozo
Pozo / index.html
Created November 24, 2015 15:44
Repository build status from GitLab CI with AngularJs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Repository build status from GitLab CI</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
</head>
<body>
<div ng-app="statuses" ng-controller="gitlabCtrl as gitlab">
@Pozo
Pozo / gist:727adc9c2c7935b8e2d8
Created November 24, 2015 13:27
Repository build status from GitLab CI
https://gitlab.com/api/v3/projects/$REPO_ID/repository/commits/$COMMIT_SHA?private_token=$PRIVATE_TOKEN
@Pozo
Pozo / gist:1004284
Created June 2, 2011 11:48
IBM key punch 029 decoder
<?php
/**
* IBM key punch 029 decoder
* http://en.wikipedia.org/wiki/Punched_card
*
* control characters not implemented but you can do it from this link
*
* http://www.cs.uiowa.edu/~jones/cards/codes.html
*
* @param string binary chain represent EBCDIC character set