Skip to content

Instantly share code, notes, and snippets.

View thijzert's full-sized avatar

Thijs van Dijk thijzert

  • Den Haag, Nederland
View GitHub Profile
@thijzert
thijzert / encoded-word.php
Last active November 9, 2017 10:36
MIME encoded-word (RFC2047) decoder
<?php
/**
* @param string $value Raw MIME header field
* @return string UTF-8 subject
**/
function decode_header_field( $value )
{
if ( preg_match( "/^\\=\\?([a-z0-9-]+)\\?([QB])\\?(.*)\\?\\=\$/i", $value, $sub ) )
{
@thijzert
thijzert / bad-passwords.php
Last active February 26, 2018 15:33
Bad password generation
<?php
/**
* Note: from PHP 7.0 and up, rand() is identical to mt_rand().
* In order to test both functions, run this file on PHP 5.6 or below.
*/
$date = 'Tue, 21 Feb 2018 11:21:40 +0100';
$hash = '$1$Wp8cWAg7$stCx1RGCLwwZmYJi9eKRI0';
@thijzert
thijzert / .vimrc
Created February 29, 2012 21:21
My vimrc
" This is my personal .vimrc file.
"
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Source a global configuration file if available