Skip to content

Instantly share code, notes, and snippets.

@jfloff
jfloff / latex-tips.tex
Created January 21, 2016 11:44
Latex Image tips
% 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 / gist:4750950
Last active May 18, 2019 10:12
Virtual Hosts for MAMP
  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:

@jfloff
jfloff / Client.java
Last active September 9, 2021 09:36
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.
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 / mamp.md
Last active March 6, 2024 09:43
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: