Skip to content

Instantly share code, notes, and snippets.

@fenprace
fenprace / Dockerfile
Last active June 14, 2021 06:21
Minimal Jupyter-lab image based on Debian Stable
FROM debian:stable
EXPOSE 8888
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y build-essential libssl-dev libffi-dev python3 python3-pip python3-dev
RUN pip3 install --no-input jupyterlab
CMD jupyter-lab --allow-root --ip 0.0.0.0
@fenprace
fenprace / quick_sort.erl
Created June 1, 2013 15:43
My quick sort
-module(QS).
-export([quick_sort/1]).
quick_sort([]) -> [];
quick_sort([X]) -> [X];
quick_sort([X, Y]) ->
if
X =< Y -> [X, Y];
{
"posts":[
{"1-cheat-sheets.markdown": {"title": "Cheet Sheets"}},
{"2-blog-like-a-fake-hacker.markdown": {"title": "Blog lie a fake hacker"}}
]
}
@fenprace
fenprace / install.sh
Last active December 12, 2015 02:18
Hacked xdg-open to support "subl://" for linux.
#!/bin/sh
sudo mv /usr/bin/xdg-open /usr/bin/xdg-open.bak
sudo curl https://gist.github.com/raw/4697254/16b3ce7ae4c4e63162ca0d9e47b2805d410bfa14/xdg-open.rb -o /usr/bin/xdg-open
sudo chmod a+x /usr/bin/xdg-open
@fenprace
fenprace / subl
Created August 16, 2012 02:07
make Sublime Text 2 launch without any echo.
#!/bin/bash
/usr/local/Sublime\ Text\ 2/sublime_text $@ &