Skip to content

Instantly share code, notes, and snippets.

@fj
fj / happy_holidays.rb
Created December 12, 2013 19:17
Happy holidays from UpHex (http://uphex.com)! This snowflake is actually a (minimally) obfuscated Ruby program. Run with `ruby happy_holidays.rb`.
s="U1RET1VULnN5bmMgPSB0cnVlCmxldHRlcl9kZWxheSwgZnJhbWVfZGVsYXkgPSAwLjA4L
CAwLjA0CnMgPSAiSGFwcHkgSG9saWRheXMgZnJvbSBVcEhleCEiCm0gPSAld3ssIC4gOiAhI
F4 gK
yA qIDA gI
yB PI EB 9C
nU gPSAiI C I gKiAoc y5
za Xp lK Q o Kc HJ pb
nQ gIlx yIC Aje 3V9 XHI iOwoK eC
A9 I C V3 ey 0 g Ly
B8 IF x cfT sKe G wg PS
@fj
fj / gist:7621449
Created November 23, 2013 23:42
readthedocs.com erroring out
╭── jxf@tesseract · 2013-11-23 · 18:19:58
│ (master)
│ /home/jxf/src/projects/docker/docs
╰─▶ ψ curl -sL -w "%{http_code}\\n" http://readthedocs.com -o /dev/null
500
@fj
fj / gist:7605618
Created November 22, 2013 19:40
Hypothetical deployment YAML for hypothetical CMDB/deployment tool.
strategies:
# deployment mechanisms
-
name: ec2-production
# config for deploying to production
-
name: ec2-staging
# config for deploying to staging
-
name: vagrant-local-development
@fj
fj / output
Created November 12, 2013 01:12
╭── jxf@tesseract · 2013-11-11 · 20:11:34
│ ‹ruby:ruby-2.0.0-p247@›
│ (master *)
│ /home/jxf/src/projects/rspec-core
╰─▶ ψ bundle update
Updating git://github.com/rspec/rspec.git
Updating git://github.com/rspec/rspec-expectations.git
Updating git://github.com/rspec/rspec-mocks.git
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
@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.