Skip to content

Instantly share code, notes, and snippets.

View whitequark's full-sized avatar
🐈‍⬛

Catherine whitequark

🐈‍⬛
View GitHub Profile
Do not insert devices in the wrong orientation or incorrectly.
Make sure that the positive and negative terminals of power supplies are connected properly.
Otherwise, the current or power consumption may exceed the absolute maximum rating, and
exceeding the rating(s) may cause the device breakdown, damage or deterioration, and may
result injury by explosion or combustion.
In addition, do not use any device that is applied the current with inserting in the wrong
orientation or incorrectly even just one time.
@whitequark
whitequark / install.sh
Last active August 29, 2015 14:03
install lz4 from source
#!/bin/sh -ex
V=r119
curl -OJL https://github.com/Cyan4973/lz4/archive/${V}.tar.gz
tar -zxvf lz4-${V}.tar.gz
cd lz4-${V}
make
sudo make install
@whitequark
whitequark / install.sh
Last active August 29, 2015 14:03
install mupdf from source
#!/bin/sh -ex
sudo apt-get install libjbig2dec0-dev libjpeg8-dev libfreetype6-dev libopenjpeg-dev zlib1g-dev libmupdf-dev libv8-dev libssl-dev
MUPDFREV=eebc338
curl -L "http://git.ghostscript.com/?p=mupdf.git;a=snapshot;h=${MUPDFREV};sf=tgz" -o mupdf-${MUPDFREV}.tgz
curl -LO "https://gist.github.com/whitequark/57aacfd4c7428f979ba9/raw/f8d6077285d3458a7cabb5e2e0e06c494b30179b/use_openjpeg_1.5.patch"
tar xf mupdf-${MUPDFREV}.tgz
cd mupdf-${MUPDFREV}
patch -p1 <../use_openjpeg_1.5.patch
> (Nokogiri::HTML.parse(File.read('bookmarks_7_25_14.html'))/"a").map {|x| x['href']}.grep(/z0r.de/) # Chrome, Y U NO MAKE Ctrl-C WORK
=> ["http://z0r.de/15",
"http://z0r.de/204",
"http://z0r.de/149",
"http://z0r.de/2061",
"http://z0r.de/2140",
"http://z0r.de/16",
"http://z0r.de/1623",
"http://z0r.de/1672",
"http://z0r.de/1606",
type json = [%import: Yojson.Safe.json] [@@deriving Show]
@whitequark
whitequark / example.sh
Last active August 29, 2015 14:06 — forked from mbj/example.sh
# chruby-exec 2.1.2 -- ruby y.rb
{:a=>:foo}
# chruby-exec 2.1.3 -- ruby y.rb
y.rb:2: syntax error, unexpected modifier_if
a: if true; :foo; end
^
y.rb:2: syntax error, unexpected keyword_end, expecting end-of-input
@whitequark
whitequark / 1.readme.md
Last active August 29, 2015 14:07
Does rails/activeform plagiarize apotonick/reform?

No.

Manual examination revealed little similarities in code structure. Not content with that, I decided to also verify it algorithmically.

I used Sherlock for testing. Specifically I did this:

git clone https://github.com/rails/activeform
git clone https://github.com/apotonick/reform
./sherlock -t 10% `find activeform -name *.rb` `find reform -name *.rb` \

| grep activeform | grep reform >results.txt

@whitequark
whitequark / gist:5e50246acea21f9d1312
Last active August 29, 2015 14:08
OCaml code and corresponding assembly
OCaml code:
let ptr_of_raw_address addr =
CPointer {
reftype = Void; raw_ptr = Raw.PtrType.of_int64 addr;
pmanaged = None; pbyte_offset = 0; }
Assembly:
0x41ec30 sub $0x8,%rsp ; make a frame
<Multi_key> <O> <O> : "ಠ_ಠ" # FACE OF DISAPPROVAL
<Multi_key> <t> <f> : "(╯°□°)╯︵ ┻━┻" # TABLE FLIP
<Multi_key> <q> <b> : "/人◕ ‿‿ ◕人\" # SIGN A CONTRACT
<Multi_key> <w> <t> <f> : " (ノಠ益ಠ)ノ" # WHAT THE FUCK
@whitequark
whitequark / gist:447979e153b30e870064
Last active August 29, 2015 14:14
(someone else wrote this)
extern const float main[];
const float main[] = {
-8.10373123E+22,
0.0000000000000000000000000000932878576,
0.000000000000000000000000000000000000000000257838917,
0.000000000000000000000000000000000000000435859874,
-0.000000000000000000000000000000616297582,
0.0000000000000000000000000000000000000000147374559,
0.00000000000000000000000000000114188386,
0,