Skip to content

Instantly share code, notes, and snippets.

Avatar

Bacluc BacLuc

View GitHub Profile
@BacLuc
BacLuc / StateMachine
Created Apr 6, 2019 — forked from elandau/StateMachine
Rx based state machine
View StateMachine
package com.netflix.experiments.rx;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observable.OnSubscribe;
@BacLuc
BacLuc / PaymentEvent.java
Created Apr 6, 2019
rx based state machine
View PaymentEvent.java
interface PaymentEvent {
}
View saturdayExercises.php
<?php
/*
Skript um Samstage auszurechnen
*/
echo "<html>
<body>
<form action='' method='post'>
<input type='date' name='anfangsdatum' value='".date("Y-m-d")."'>
@BacLuc
BacLuc / merge-single-pdfs
Created Jul 1, 2018
merge pdfs of single info for scout camp with common infos
View merge-single-pdfs
#!/bin/bash
DIR="Einzelne"
DIR_MERGED="Einzelne-merged"
for filename in $(ls $DIR); do
FROM=$DIR/$filename
TO=$DIR_MERGED/$filename
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$TO $FROM lagerinfo_notfallblatt.pdf
done
View Regex.java
package com.company;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Regex {
public static void main(String[] args) {
View src_com_company_Main.java
package com.company;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
View f8734ef97696d270da5adb0e140eb454-master_.idea_f8734ef97696d270da5adb0e140eb454-master.iml
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@BacLuc
BacLuc / WarmUp.java
Last active May 16, 2017
count two following x with overlapping
View WarmUp.java
class Main{
int countXX(String str) {
boolean lastOneIsX = false;
int countXX = 0;
for(int i=0;i<str.length(); i++){
if(str.charAt(i)=="x".charAt(0)){
if(lastOneIsX){
countXX++;
}
lastOneIsX = true;
@BacLuc
BacLuc / listtest_Language.java
Created May 12, 2017
test remove elements with various methods
View listtest_Language.java
package listtest;
/**
* Created by lucius on 12.05.17.
*/
public class Language {
private String name;
public Language(String name) {
this.name = name;
@BacLuc
BacLuc / CsvResponse.php
Last active Mar 20, 2017 — forked from mathewbyrne/CsvResponse.php
A small Symfony 2 class for returning a response as a CSV file. Based on the Symfony JsonResponse class.
View CsvResponse.php
<?php
namespace Jb\AdminBundle\Http;
use Symfony\Component\HttpFoundation\Response;
class CsvResponse extends Response
{
protected $data;
protected $originalData;
You can’t perform that action at this time.