Skip to content

Instantly share code, notes, and snippets.

@fj
fj / gist:7124501
Last active December 26, 2015 08:49
**** Repository: ****
git@github.com:fj/sample-git-rebase-failure-case.git
**** Topological history: ****
* dc90b7e @ 2013-10-23 14:52:08 -0400 » Commit #9, after legitimate merge commit (John Feminella)
| (HEAD, master)
* 97ba1d7 @ 2013-10-23 14:50:53 -0400 » Commit #8, legitimate --no-ff merge commit (John Feminella)
|\
@fj
fj / gist:7124133
Created October 23, 2013 18:38
Issues with Git when --preserve-merging and deleting a merge commit.
git rebase -i --preserve-merges X
before:
master, HEAD
v
X---*---*---m1-------------m2---* // rebase to delete spurious merge commit m1
\ / \ /
a1 b1---b2---b3
expected:
@fj
fj / wager.textile
Last active December 25, 2015 21:58
A friendly wager between Steven Haddox and myself.

Wager: loser donates $100 to the winner’s named charity.

Setup:

  • A reference list of the top 10,000 Alexa domains will be used (“List”).
  • Ten domains are selected at random from the List.
  • Ten government websites (any domain containing “.gov.” or ending in “.gov”) are selected at random from the List.
  • The twenty domains are paired, one from each group, into ten pairs.
  • Random numbers used for the selection will be generated by random.org.
Now:
---m0-------------------m1---m2---m3-------------m4---m5----m6---m7---(...)
\ / \ / \ /
b0---b1---b2---b3 b4--(C)--b5 b6
Desired (C and m6 removed):
@fj
fj / gist:6427816
Created September 3, 2013 18:36
Bug in dotcloud client installation under Python 3.3
╭── jxf@tesseract · 2013-09-03 · 14:32:50
│ ‹ruby:2.0.0-p247@web-scaffold›
│ ‹virtualenv:dotcloud›
│ /home/jxf/src/projects
╰─▶ ψ pip install dotcloud
Downloading/unpacking dotcloud
Downloading dotcloud-0.9.5.tar.gz
Running setup.py egg_info for package dotcloud
Downloading/unpacking argparse (from dotcloud)
@fj
fj / wakka-wakka
Created July 9, 2013 15:46
A poem that is approximately a valid Perl program (but then, so is most keyboard mashing). Modified from: http://poetry.about.com/od/poetryplay/l/blwakawaka.htm
< > ! * ' ' # # Waka waka bang splat tick tick hash,
^ " ` $ $ - # Caret quote back-tick dollar dollar dash,
! * = @ $ _ # Bang splat equal at dollar under-score,
% * < > ~ # 4 # Percent splat waka waka tilde number four,
& [ ] . . / # Ampersand bracket bracket dot dot slash,
| | { , , Segmentation fault # Bar bar curly-bracket comma comma CRASH.
@fj
fj / gist:5191226
Created March 18, 2013 22:04
My git alias for logs.
log --format=format:\"%C(yellow bold)%h%Creset @ %C(blue)%cd%C(reset) » %C(white)%s%C(reset) (%C(green)%cN%C(reset)) %+d\" --topo-order --graph --date=iso
@fj
fj / gist:5060434
Created February 28, 2013 21:53
Andrew Mason's firing letter from Groupon. February 28, 2013.
(This is for Groupon employees, but I’m posting it publicly since it will leak anyway)
People of Groupon,
After four and a half intense and wonderful years as CEO of Groupon, I’ve decided that I’d like to spend more time with my family. Just kidding – I was fired today. If you’re wondering why… you haven’t been paying attention. From controversial metrics in our S1 to our material weakness to two quarters of missing our own expectations and a stock price that’s hovering around one quarter of our listing price, the events of the last year and a half speak for themselves. As CEO, I am accountable.
You are doing amazing things at Groupon, and you deserve the outside world to give you a second chance. I’m getting in the way of that. A fresh CEO earns you that chance. The board is aligned behind the strategy we’ve shared over the last few months, and I’ve never seen you working together more effectively as a global company – it’s time to give Groupon a relief valve from the public noise.
For those who are conc

Retrieval of an arbitrary item from a linked list is O(n). Arbitrary means any of the elements are eligible for selection, without loss of generality.

However, retrieval of a specific item from a linked list has nothing to do with how many items are in the list. It is therefore O(1). Retrieving the 50th item from a linked list takes the same amount of time, no matter whether the list has 50 elements, 50M elements, or 50^50! elements.

FROM alpine:latest
MAINTAINER John Feminella <jxf@jxf.me>
RUN apk add --update \
inotify-tools \
qemu-system-x86_64 \
&& rm -rf /var/cache/apk/*
COPY mysqld.bin run.sh fs/etc.iso fs/data.ffs /unikernel/
WORKDIR /unikernel
CMD ["/unikernel/run.sh"]