Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hellothisisflo on github.
  • I am hellothisisflo (https://keybase.io/hellothisisflo) on keybase.
  • I have a public key ASDMWFM25XHqQcbUoZ2MRdiuh5FE57RoSUaUWrzalgndEwo

To claim this, I am signing this object:

@HelloThisIsFlo
HelloThisIsFlo / codechef_python_test_helper.py
Created October 16, 2018 13:17
Python Test Helper for CodeChef
import builtins
import sys
import textwrap
import mock
def mock_readline_and_assert_stdout(function_to_run, mocked_stdin, expected_stdout):
# Utility function that allow you to assert a given STDIN produce the expected STDOUT.
# Useful for TDDing CodeChef challenges: https://www.codechef.com/SNCKQL19/problems/QUALPREL
@HelloThisIsFlo
HelloThisIsFlo / Unifi-docker-compose.yml
Created September 1, 2018 14:31
Docker Compose file for the Unifi Controller
version: '2.3'
services:
unifi:
image: jacobalberty/unifi:5.6.39
restart: always
volumes:
- './config/lib:/var/lib/unifi'
- './config/log:/var/log/unifi'
- './config/run:/var/run/unifi'
ports:

Keybase proof

I hereby claim:

  • I am floriankempenich on github.
  • I am thisisfloriank (https://keybase.io/thisisfloriank) on keybase.
  • I have a public key ASC5F9xYJHnM8TM4O_WcCuI-afmM4jFUu_PeAm8K5TQj8go

To claim this, I am signing this object:

@HelloThisIsFlo
HelloThisIsFlo / brunch-livereload.sh
Created November 16, 2017 19:56
Livereload - Javascript / Brunch - w/ Docker
#!/bin/bash
## Config #############
HTML_DIR=$(pwd)/public
DOCKER_CONTAINER=livereload
DOCKER_PORT=1234
TMPDIR=/tmp/livereload-script
#########################
function tmp_file {
public class HibernateBookRepository implements BookRepository {
private final HibernateCrudBookRepository crudBookRepository;
private final JpaMapper jpaMapper;
@Autowired
public HibernateBookRepository(HibernateCrudBookRepository crudBookRepository, JpaMapper jpaMapper) {
this.crudBookRepository = crudBookRepository;
this.jpaMapper = jpaMapper;
}
public interface BookRepository {
BookId save(Book book);
Book findById(BookId bookId);
Book findByTitle(String title);
Book findByAuthor(String author);
List<Book> findAll();
}
public class XMLParserWeirdImpl implements XMLParser {
private ParseFileFactory xmlFileFactory;
private XMLParserWeirdImpl() {
ParseType xmlType = new ParseType(
Parsing.Type.XML,
Parsing.Xml.ExtraColumn
);
this.xmlFileFactory = new ParseFileFactory(xmlType);
public class SomeClass {
XmlParser xmlParser;
public SomeClass(XmlParser xmlParser) {
this.xmlParser = xmlParser;
}
public List<Book> findSpecificBookInFile(String bookName, String filePath) {
List<Book> fromFile = xmlParser.parseBooks(fileName);
public interface XMLParser {
List<Book> parseBooks(String fileName);
// Other methods added here ...
}