Skip to content

Instantly share code, notes, and snippets.

Alessandro Baffa alebaffa

Block or report user

Report or block alebaffa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View docker-compose.yaml
version: '3'
container_name: java-api
build: .
- oracledb
- redis
- "443:443"
alebaffa /
Created Feb 22, 2018
elasticsearch client from jupyter
## Import all the needed libraries
from elasticsearch import helpers
from elasticsearch import Elasticsearch
import os
import sys
import json
import logging.config
from elasticsearch import RequestsHttpConnection
## Create connection using proxy
alebaffa / cloudSettings
Last active Aug 28, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
View gist:a72f2eb7af1e06373f706a3b80b2ab15
### Keybase proof
I hereby claim:
* I am alebaffa on github.
* I am alebaffa ( on keybase.
* I have a public key ASCuG3qyeOFenECA4Lil5-V8vpI8ilfcZK9dVV5lpQVvfgo
To claim this, I am signing this object:
alebaffa /
Last active Jan 24, 2018
Git squash alternatives

Git Squash alternatives:

  • git rebase -i HEAD~X - this allows you to merge interactively several commits
    • then fixup OR pick OR reword AND push --force
  • git reset --hard HEAD~X - this rollbacks the index back to X commits (check git status before doing this. Commit first)
    • commit again using just one commit
  • git reset --hard COMMIT_ID - this rollbacks the index back to the commit_id
alebaffa /
Last active Sep 15, 2017
Get name of the current branch in git
branch="$(git rev-parse --abbrev-ref HEAD)"
echo ${branch}
alebaffa / cloudSettings
Last active Jul 3, 2017
Visual Studio Code Sync Settings Gist
View cloudSettings
public void should_return_the_string_converted() throws IOException {
HtmlTextConverter converter = new HtmlTextConverter("");
Reader stringReader = new StringReader("foo");
assertThat(converter.convertToHtml(stringReader), is("foo<br />"));
public String convertToHtml() throws IOException {
return convertToHtml(new FileReader(fullFilenameWithPath));
protected String convertToHtml(Reader reader) throws IOException {
BufferedReader bufferedReader = new BufferedReader(reader);
String line = bufferedReader.readLine();
String html = "";
while (line != null) {
public void should_convert_to_html() throws IOException {
HtmlTextConverter converter = new FakeHtmlTextConverter("ciao");
assertThat(converter.convertToHtml(), is("ciao<br />"));
You can’t perform that action at this time.