Skip to content

Instantly share code, notes, and snippets.

View Zegnat's full-sized avatar

Martijn van der Ven Zegnat

View GitHub Profile
<?php //shared functions
/* ====================================================================================================================== */
/* NoNonsense Forum v22 © Copyright (CC-BY) Kroc Camen 2012
licenced under Creative Commons Attribution 3.0 <creativecommons.org/licenses/by/3.0/deed.en_GB>
you may do whatever you want to this code as long as you give credit to Kroc Camen, <camendesign.com>
*/
//formulate a URL (used to automatically fallback to non-pretty URLs when htaccess is not available),
//the domain is not included because it is not used universally throughout (absolute-base / relative links)
function url ($action='index', $path='', $file='', $page=0, $id='') {
@Zegnat
Zegnat / H9RBS.decoded.js
Created May 9, 2012 19:07
HTML9 Responsive Boilerstrap JS (v0.0001)
var 흤 = [
"<pre style=\"font-family: monspace; font-size: 30px; width: 900px; margin:auto;\"><br>",
"write",
"………………………………………………………………………………………………<br>",
"………………….._,,-~’’’¯¯¯’’~-,,…………………………………………………………<br>",
"………………..,-‘’ ; ; ;_,,---,,_ ; ;’’-,…………………………….._,,,---,,_………………<br>",
"……………….,’ ; ; ;,-‘ , , , , , ‘-, ; ;’-,,,,---~~’’’’’’~--,,,_…..,,-~’’ ; ; ; ;__;’-,……………<br>",
"……………….| ; ; ;,’ , , , _,,-~’’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ¯’’~’-,,_ ,,-~’’ , , ‘, ;’, …………<br>",
"……………….’, ; ; ‘-, ,-~’’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’’-, , , , , ,’ ; |…………<br>",
"…………………’, ; ;,’’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’-, , ,-‘ ;,-‘…………<br>",
@Zegnat
Zegnat / redirect.js
Created May 1, 2012 14:26
Redirect Tumblr page to day page. [JS]
(function(a){
if (!0{block:DayPage}1{/block:DayPage} && a) {
window.location.replace('/day/'+a+'/');
}
})([''{block:Posts}{block:Date}{block:NewDayDate},'{Year}/{MonthNumberWithZero}/{DayOfMonthWithZero}'{/block:NewDayDate}{/block:Date}{/block:Posts}][1]);
var tld = window.location.hostname.split('.').pop(),
tldExtend = {uk:'GB',za:'ZA',ie:'IE',au:'AU'};
while (treeWalker.nextNode()) {
cN = treeWalker.currentNode;
cNlang =
cN.getAttribute('lang')||cN.getAttribute('xml:lang')||
(('getAttribute' in cN.parentNode&&(l=cN.parentNode.getAttribute('lang')||cN.parentNode.getAttribute('xml:lang'))&&!cN.setAttribute('lang',l))?l:null)||
window.navigator.language;
if (cNlang=='en'&&tld in tldExtend) cNlang+='-'+tldExtend[tld];
@Zegnat
Zegnat / README.mdown
Created September 25, 2011 10:46
A plugin for Jekyll 0.11.0 to allow different types of datestamps for blog posts.

ISO 8601 datestamp support for Jekyll

About

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.

Installation

@Zegnat
Zegnat / Original.txt
Created September 25, 2011 13:31
Regular expression for ISO 8601 datestamps
^
(\+|-)? # 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
)|(
@Zegnat
Zegnat / README.md
Created July 4, 2011 10:08
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
  1. honorific-prefix
@Zegnat
Zegnat / README.md
Created July 1, 2011 09:01
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
Zegnat / builder.php
Created April 18, 2011 10:06
Form builder
<?php
# ### ### ### ### ### ### ### ### ### ###
# HEAD
header('Content-Type: text/html; charset=utf-8');
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('memory_limit', '12M');
function pre_var_dump() {
@Zegnat
Zegnat / lol.class.php
Created February 23, 2011 08:56
The lol class will let you code your applications with the word lol only! (Or any other word.)
<?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 = '';