Skip to content

Instantly share code, notes, and snippets.

Thijs van Dijk thijzert

  • Den Haag, Nederland
Block or report user

Report or block thijzert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thijzert
thijzert / bad-passwords.php
Last active Feb 26, 2018
Bad password generation
View bad-passwords.php
<?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 / encoded-word.php
Last active Nov 9, 2017
MIME encoded-word (RFC2047) decoder
View encoded-word.php
<?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 ) )
{
View 20161230_1620_geluidsoverlast-seven-waves.md

Betreft: Geluidsoverlast Huisman / Seven Waves
Datum: 30 december 2016

Aan:

  • Huisman Equipment BV
  • Damen Shiprepair Schiedam
  • Gemeente Schiedam
  • DCMR Milieudienst Rijnmond
@thijzert
thijzert / button.css
Last active Oct 14, 2016
Scriptless fork button
View button.css
#fork-me a
{
background-color: #eee;
background-image: -webkit-linear-gradient(top,#fcfcfc,#eee);
background-image: -moz-linear-gradient(top,#fcfcfc,#eee);
background-image: linear-gradient(to bottom,#fcfcfc,#eee);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfcfc', endColorstr='#eeeeee')";
height: 26px;
display: inline-block;
View keybase.md

Keybase proof

I hereby claim:

  • I am thijzert on github.
  • I am thijzert (https://keybase.io/thijzert) on keybase.
  • I have a public key whose fingerprint is 6A94 F9A2 DFE5 40E3 067E C282 2AFE 9EFA 718B 6165

To claim this, I am signing this object:

View RickshawGraph.md

Graphing Widget

The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.

It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.

Supported HTML data fields

@thijzert
thijzert / progressbar.inc
Created Jun 11, 2012
A PHP progress bar
View progressbar.inc
<?php
require_once( "termcolours.inc" );
class ProgressBar
{
protected $ticktime = false;
protected $exp;
protected $xsquare;
@thijzert
thijzert / stats.inc
Created Jun 11, 2012
Statistical simulations in PHP
View stats.inc
<?php
class St
{
/**
* Generate a random number in the interval (0,1).
*
* Using the parameters $closed_left and/or $closed_right, the interval may
* be closed to [0,1), (0,1], or [0,1].
@thijzert
thijzert / termcolours.inc
Created Jun 5, 2012
Terminal colours in PHP
View termcolours.inc
<?php
// 'Normal' colours:
function black($s) { return _term_colour( '0;30', $s ); }
function blue($s) { return _term_colour( '0;34', $s ); }
function green($s) { return _term_colour( '0;32', $s ); }
function cyan($s) { return _term_colour( '0;36', $s ); }
function red($s) { return _term_colour( '0;31', $s ); }
function purple($s) { return _term_colour( '0;35', $s ); }
function yellow($s) { return _term_colour( '0;33', $s ); }
@thijzert
thijzert / .bash_aliases
Last active Oct 2, 2015
Useful bash aliases
View .bash_aliases
alias IP="grep -oP '([0-9]+\.){3}[0-9]+' | grep -vP '192\.168\.[0-9]+\.[0-9]+'"
alias rdp="rdesktop -g 1600x1000 -a 16 -N -u Administrator -k en-us -r clipboard:PRIMARYCLIPBOARD"
alias bbc3='mplayer http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_q'
alias klara='mplayer http://mp3.streampower.be/klara-high.mp3'
alias radio4='mplayer http://icecast.omroep.nl/radio4-bb-mp3'
alias svngrep='find . \
-path ".git" -prune -o -path "*.git" -prune \
-o -path ".svn" -prune -o -path "*/.svn" -prune \
You can’t perform that action at this time.