Skip to content

Instantly share code, notes, and snippets.

Kasper Fabæch Brandt poizan42

Block or report user

Report or block poizan42

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
@poizan42
poizan42 / checkmail.php
Created May 19, 2012
Mail verifier in php
View checkmail.php
<?php
/*
Copyright (C) 2012 Kasper F. Brandt
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@poizan42
poizan42 / jsquine.js
Created Jul 29, 2012
javascript quine-bomb
View jsquine.js
a1="function a() { p='a1=\"'+a1.replace(/\\\\/g,'\\\\\\\\').replace(/\"/g,'\\\\\"')+'\"; a2=\"'+a2+'\";'+a1+a2;";
a2="document.write('<script>' + p + '</'+'script>');document.write('<script>' + p + '</'+'script>')}a()";
function a() {
p='a1="'+a1.replace(/\\/g,'\\\\').replace(/"/g,'\\"')+'"; a2="'+a2+'";'+a1+a2;
document.write('<script>' + p + '</'+'script>');
document.write('<script>' + p + '</'+'script>')
}a()
@poizan42
poizan42 / gist:5061991
Last active Dec 14, 2015
Fix all git committer dates to author dates
View gist:5061991
# Fix all git committer dates to author dates:
git filter-branch --env-filter \
'export GIT_COMMITTER_DATE="$(git show --pretty=fuller $GIT_COMMIT | grep "AuthorDate:" | sed -re "s/^AuthorDate:\s+(.*)$/\\1/")"'
@poizan42
poizan42 / brainfuck.htm
Created Oct 4, 2013
Brainfuck intepreter written in JavaScript (and HTML)
View brainfuck.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--
Brainfuck interpreter in JavaScript
Made 2009 by Kasper F. Brandt
I hereby release this code (both html and JavaScript) into the public domain
-->
<html>
<head>
<title>Brainfuck interpreter</title>
@poizan42
poizan42 / mx-scrape.php
Last active Dec 30, 2015
mx.dk recent news scraper
View mx-scrape.php
<?php
class MetroXpress
{
const userAgent = null;
private static $monthMap = Array(
'januar' => 1,
'februar' => 2,
'marts' => 3,
@poizan42
poizan42 / unpack-youtube-dump.py
Last active Jan 1, 2016
Read video data from saved combined traffic dumps of a youtube video, such as those created by `tshark -z follow,tcp,raw,...`
View unpack-youtube-dump.py
#!/usr/bin/python
import sys
import os
from urlparse import urlparse,parse_qs
def readChunk(f):
get = f.readline()
if get == '':
raise EOFError()
@poizan42
poizan42 / StreamTools.cpp
Last active Aug 29, 2015
ClrHacks. Kids, don't try this at home.
View StreamTools.cpp
// StreamTools.h
#pragma once
#include "StdAfx.h"
using namespace System;
using namespace System::IO;
using namespace System::Runtime::InteropServices;
View CCITTFaxFileScan.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CCITTFaxFileScan
{
class Program
@poizan42
poizan42 / get-undelivered-list.py
Created May 27, 2014
Script which generates a json formatted list of email adresses and reasons from bounce mails loaded from an imap account
View get-undelivered-list.py
#!/usr/bin/env python
import imaplib
import email
import json
import re
from getpass import getpass
label = "undelivered-mails"
username = "user@gmail.com"
addrfilename = 'failed-addresses.txt'
View poor-mans-parameterized-queries.php
<?php
class MySQLException extends Exception
{
private $errNo;
private $errStr;
public function __construct($message = null, $errNo = null, $errStr = null)
{
$this->message = $message;
$this->errNo = $errNo;
You can’t perform that action at this time.