Skip to content

Instantly share code, notes, and snippets.

Martijn van der Ven Zegnat

Block or report user

Report or block Zegnat

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
Zegnat / NIM.cpp
Created Dec 1, 2010
Pearls before Swine. For school, I am not a C++ developer and never will be.
View NIM.cpp
#include <iostream>
#include <conio+.h>
#include <cmath>
#include <time.h>
using namespace std;
#define MIN_LINES 2
#define MAX_LINES 8
Zegnat / gist:811387
Created Feb 4, 2011
CASSIS: Scooping
View gist:811387
// Javascript needs you to declare variables inside functions or they will be created in the global scoop.
$var1 = 'global';
function change() {
if (js()) eval('var $var1;');
$var1 = 'scooped';
// PHP needs you to declare variables inside functions if you want them to be in the gobal scoop.
$var2 = 'global';
Zegnat / lol.class.php
Created Feb 23, 2011
The lol class will let you code your applications with the word lol only! (Or any other word.)
View lol.class.php
class lol {
private $functions;
function __construct() {
$functions = get_defined_functions();
$this->functions = $functions['internal'];
public function __call($name, $arguments) {
$l = $i = strlen($name);
$repeater = '';
View builder.php
# ### ### ### ### ### ### ### ### ### ###
header('Content-Type: text/html; charset=utf-8');
ini_set('display_errors', '1');
ini_set('memory_limit', '12M');
function pre_var_dump() {
Zegnat /
Created Jul 1, 2011
Comic Sans Button!

Comic Sans Button!

De Coen & Sandershow heeft een Comic Sans dag ter leven geroepen en Tim heeft er een handige bookmarklet (Wikipedia legt uit) voor gemaakt om het te promoten. Deze is te vinden als de Comic Sans Button!

Een probleem met de originele button.

De originele knop veranderd niet alleen het lettertype van de pagina maar laat ook sporen achter. Normaal maakt dit niks uit maar in theorie kan het een website in de war brengen. Deze nieuwe bookmarklet lost dat probleem op!

Zegnat /
Created Jul 4, 2011
The future of HTML, marking up myself.

How to mark-up yourself.

Currently employing:

  • µF: hCard
    1. fn
    2. n
      1. given-name
      2. family-name
      3. honorific-prefix
Zegnat / README.mdown
Created Sep 25, 2011
A plugin for Jekyll 0.11.0 to allow different types of datestamps for blog posts.
View README.mdown

ISO 8601 datestamp support for Jekyll


Jekyll is a static site generator with blogging capabilities. For blogging it looks for files starting with a datestamp. In its original form, Jekyll only supports hyphen separated calendar dates (YEAR-MONTH-DAY).

This plugin file tries to implement ISO 8601 datestamps and give you a little more freedom when stamping your posts and building your permalinks with dates.


Zegnat / Original.txt
Created Sep 25, 2011
Regular expression for ISO 8601 datestamps
View Original.txt
(\+|-)? # Extended year?
(\d{4,}) # Year
-? # Optional separator
(0[1-9]|1[012]) # Month, 01 to 12
(?(?<=-\d\d)-) # Require another separator if we used one before
(0[1-9]|[12][0-9]|3[01]) # Day, 01 to 31
View gist:1376327
var tld = window.location.hostname.split('.').pop(),
tldExtend = {uk:'GB',za:'ZA',ie:'IE',au:'AU'};
while (treeWalker.nextNode()) {
cN = treeWalker.currentNode;
cNlang =
(('getAttribute' in cN.parentNode&&(l=cN.parentNode.getAttribute('lang')||cN.parentNode.getAttribute('xml:lang'))&&!cN.setAttribute('lang',l))?l:null)||
if (cNlang=='en'&&tld in tldExtend) cNlang+='-'+tldExtend[tld];
Zegnat /
Created Feb 24, 2012
Fixing your skip links. [JS]

Fixing your skip links.

Read Damon Muma on this. He proposes the following jQuery solution (inspired by Thompson, fixed by me):

// Apply focus properly when accessing internal links with keyboard in WebKit browsers.
$("a[href^='#']").not("a[href='#']").click(function() {
You can’t perform that action at this time.