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 / Mandelbrot16x16-fixed.pdf
Last active Aug 29, 2015
16x16 Mandelbrot set rendered by a tint transform (it's not technically a valid pdf because it lacks lengths and the xref table which is hard to write by hand, but every reader can reconstruct them anyways). The Mandelbrot16x16-fixed.pdf file has been opened and saved with Adobe Reader which repairs the file (but makes it human unreadable).
View Mandelbrot16x16-fixed.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View q_encode.php
/*
Konverterer en streng til Q-encoding
En del spam filtrer ser ud til at regne det for mere sandsyneligt at en mail er spam hvis
subject og from er base64 encodet - og der er ingen grund til at udfordre skæbnen...
Q-encoding er en modificeret udgave af quoted-printable, som benyttes til mime headers
quoted-printable er beskrevet på wikipedia på http://en.wikipedia.org/wiki/Quoted-printable
forskellene der er i Q-encoding er beskrevet på http://en.wikipedia.org/wiki/MIME#Encoded-Word
Der er faktisk en funktion i php til at gøre dette - iconv_mime_encode -
denne encoder bare ikke alting korrekt (mellemrum som =20),
@poizan42
poizan42 / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@poizan42
poizan42 / get-all-ad-group-members.ps1
Created Mar 16, 2015
Get all AD group members (> 1500)
View get-all-ad-group-members.ps1
$listObj = [ADSI]"LDAP://CN=DistList,CN=Users,DC=example,DC=com"
$tmpMembers = $listObj.PSBase.Invoke('Members') | %{([System.DirectoryServices.DirectoryEntry] $_).mail}
@poizan42
poizan42 / wmain-call-stub.cpp
Last active Aug 29, 2015
stub to call wmain from main
View wmain-call-stub.cpp
#include <string>
#include <codecvt>
#include <locale>
int main(int argc, const char *argv[])
{
std::wstring_convert < std::codecvt<wchar_t, char, std::mbstate_t> > conv;
std::vector<const wchar_t*> wargv;
std::vector<std::wstring> wsargv;
wargv.resize(argc);
View bedre_write_int.c
void write_int(int n) {
// Length of INT_MIN as a decimal number is 11 (-2147483647)
char buf[11];
int neg = n < 0;
n *= 1 - 2*neg;
int pos = 11;
do {
buf[--pos] = '0' + (n % 10);
n /= 10;
} while (n);
@poizan42
poizan42 / inf-primes.v
Created Nov 27, 2014
Proof of the infinitude of primes
View inf-primes.v
Require Import Coq.ZArith.ZArith.
Require Import Coq.ZArith.Znumtheory.
Require Import Coq.Sets.Ensembles.
Require Import Coq.Sets.Finite_sets.
Require Import Coq.PArith.BinPos.
Definition Z_ens := Ensemble Z.
Print Finite.
Print Empty_set.
Definition is_empty_set U A := forall x, ~(In U A x).
@poizan42
poizan42 / triangular.v
Created Nov 11, 2014
Proof of the closed form formula for triangular numbers
View triangular.v
Require Import Coq.Arith.Div2.
Require Import Coq.Arith.Mult.
Require Import Coq.Arith.Even.
Require Import ArithRing.
Fixpoint triangular (n: nat) :=
match n with
| 0 => 0
| S n => (S n) + triangular (n)
end.
View IOMonad.sml
(* const : 'a -> 'b -> 'a
* Giver den konstante funktion der giver x. *)
fun const x _ = x
(* Lad os få os en IO monade så vi ikke skal se på alt det urene snask. *)
signature IOSig = sig
type 'a io
(* Monade operationer *)
val >>= : 'a io -> ('a -> 'b io) -> 'b io
val >> : 'a io -> 'b io -> 'b io
View keybase.md

Keybase proof

I hereby claim:

  • I am poizan42 on github.
  • I am poizan42 (https://keybase.io/poizan42) on keybase.
  • I have a public key whose fingerprint is 66C6 C343 F614 65F9 248E 204E B00A C5E2 7BCE D2B8

To claim this, I am signing this object:

You can’t perform that action at this time.