Skip to content

Instantly share code, notes, and snippets.

João Ferreira Loff jfloff

Block or report user

Report or block jfloff

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
jfloff /
Last active Sep 16, 2016
Intercepting Socket.getInputStream using AspectJ LTW
// Client: reads a string from stdin and sends it to the Server. Waits for the same message from the server.
public class Client
public static void main(String[] args) throws IOException
Socket socket = new Socket("", 1234);
jfloff /
Last active Apr 3, 2017
Script to open Eclipse Che electron app, together with the server (as docker image)
# check if docker is working
docker ps &> /dev/null
if [ $? -ne 0 ]; then
echo "[ERROR]\tCannot connect to the Docker daemon. Is the docker daemon running on this host?" 1>&2
return 1
jfloff / latex-tips.tex
Created Jan 21, 2016
Latex Image tips
View latex-tips.tex
% 2 images side-by-side aligned bottom for IEEE
\caption{The write path for Facebook’s replicated storage. On-path caches are synchronously updated; off-path caches are asynchronously invalidated. There is a single master region for each shard with the root-master cache and master database. Different shards may have masters in different regions. Even though (\textit{6a''}) is depicted in \cite{Lu2015,Bronson2013}, according to \cite{Fisk2013} that interation is actually done through Wormhole (\textit{6b''}). (Adapted from \cite{Lu2015,Fisk2013}) }
jfloff /
Last active Jan 20, 2020
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

View gist:5020211
### Sublime Files ###
### OSX ###
# Thumbnails
jfloff / gist:4757426
Created Feb 11, 2013
Terminal Quickie
View gist:4757426
  • Search command history

    $ history | grep "words to search"
jfloff /
Last active Dec 12, 2015
Sublime Text 2 Quickie


  • Swap lines up and down Eclipse style

    { "keys": ["alt+up"], "command": "swap_line_up" },
    { "keys": ["alt+down"], "command": "swap_line_down" }
  • Delete current line Eclipse style

jfloff / gist:4750950
Last active May 18, 2019
Virtual Hosts for MAMP
View gist:4750950
  1. Open hosts file:

    $ sudo subl /private/etc/hosts
  2. Place the following line at the end of the file: link
  3. Open MAMP's vhosts file:

jfloff /
Last active May 30, 2017
Git Quickie

Git commands

  • Init a git/github repo, avoiding the user/password request issue

    $ git init
    $ git add .
    $ git commit -m "Initial commit"
    # Create Github repo
    $ git remote add origin<username>/<repo_name>.git
    $ git push -u origin master
You can’t perform that action at this time.