Skip to content

Instantly share code, notes, and snippets.

@jfloff
jfloff / Client.java
Last active Sep 16, 2016
Intercepting Socket.getInputStream using AspectJ LTW
View Client.java
// Client: reads a string from stdin and sends it to the Server. Waits for the same message from the server.
import java.io.*;
import java.net.*;
public class Client
{
public static void main(String[] args) throws IOException
{
Socket socket = new Socket("127.0.0.1", 1234);
@jfloff
jfloff / latex-tips.tex
Created Jan 21, 2016
Latex Image tips
View latex-tips.tex
% 2 images side-by-side aligned bottom for IEEE
\begin{figure*}
\begin{minipage}[t]{\columnwidth}
\centering
\includegraphics[width=\linewidth]{tao}
\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}) }
\label{fig:tao}
\end{minipage}\qquad
\begin{minipage}[t]{\columnwidth}
\centering
@jfloff
jfloff / mamp.md
Last active Nov 19, 2020
How to get MAMP to work with SSL ... Yes really.
View mamp.md

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:

@jfloff
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:

    127.0.0.1 link
    
  3. Open MAMP's vhosts file:

You can’t perform that action at this time.