Skip to content

Instantly share code, notes, and snippets.

@Darksecond
Darksecond / .gitconfig
Last active March 22, 2017 15:51
Default gitignore stuff
[core]
excludesfile = ~/.gitignore.global
@Darksecond
Darksecond / design.txt
Last active September 19, 2016 12:58
libvm
libvm design
------------
Basically Gameboy Z80
registers
=========
[15...8] [7...0]
[A ] [F ]
[B ] [C ]
@Darksecond
Darksecond / README.md
Created January 11, 2016 12:25
Favicon Microgem

Favicon Microgem

This fetches all known favicons for a url. It will return an array of hashes with a href, x and y. If the size is unknown it will return 0 for x and y

@Darksecond
Darksecond / preprocessor_fun.h
Last active August 29, 2015 14:27 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@Darksecond
Darksecond / README.md
Created August 5, 2015 19:18
uPlay autokiller

This will automatically close the uPlay after game report for Ubisoft games I own. You can add your own games to the list to close uPlay after closing the game.

@Darksecond
Darksecond / phantomjs
Created May 20, 2015 10:44
phantomjs
BIN=/usr/local/bin/phantomjs.bin
RET=1
MAX=5
RUN=0
until [ ${RET} -eq 0 ]; do
${BIN} $@
RET=$?
RUN=$(($RUN +1))
# exit immediately after max crashes

Keybase proof

I hereby claim:

  • I am darksecond on github.
  • I am darksecond (https://keybase.io/darksecond) on keybase.
  • I have a public key whose fingerprint is 0674 D124 AEDF 2216 F8AC 4578 23E6 1B04 325B 7822

To claim this, I am signing this object:

@Darksecond
Darksecond / nginx.conf
Created October 8, 2012 20:24
Systemd + Unicorn + Nginx + no-downtime-reload
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.
# you generally only need one nginx worker unless you're serving
# large amounts of static files which require blocking disk reads
worker_processes 1;
# # drop privileges, root is needed on most systems for binding to port 80
@Darksecond
Darksecond / benchmark.tex
Created October 4, 2012 12:30
Benchmark hoofdstuk
Benchmark
3. Ontwerp een faciliteit om de tijd benodigd voor transport van een file van 1 MB over de
verbinding met OpenSSL te meten. Ga na welke tijd je precies meet!
4. Implementeer deze faciliteit en test hem.
5. Vergelijk de benodigde transporttijd van een file van 1 MB bij gebruik van minstens drie
verschillende cryptografische algoritmen in OpenSSL. Doe de meting minimaal 50 keer.
6. Analyseer en evalueer de uitkomst van de metingen.
<!-- zet dit in een bijlage -->
@Darksecond
Darksecond / benchmark.sh
Created October 4, 2012 09:43
Openssl benchmark script
#!/bin/bash
echo Please make sure the server is running
echo the command is:
echo openssl s_server -WWW
echo and make sure the 1mb file is in the same directory
echo to make the 1mbrf file do:
echo dd if=/dev/urandom of=1mbrf bs=1024 count=1024
echo
echo the following benchmarks each will have run 50 times
echo