Skip to content

Instantly share code, notes, and snippets.

View mpfund's full-sized avatar

Marinus Pfund mpfund

  • ifempty
  • Munich
View GitHub Profile
@mpfund
mpfund / nodejsexpress.ts
Created December 17, 2015 13:44
nodejs form with express + bodyparser
/// <reference path="node.d.ts" />
/// <reference path="express.d.ts" />
// install
// npm install express --save
// npm install body-parser
import express = require('express');
var bodyParser = require('body-parser');
var app = express();
@mpfund
mpfund / scheme.html
Last active December 1, 2015 09:32
mini scheme in javascript
<html>
<body>
<script>
"use strict";
function calc(arr) {
var m = arr.split(' ');
return calcArr(m);
}
@mpfund
mpfund / https_mitm_proxy.go
Last active July 23, 2020 20:44
Golang Http(s) mitm Proxy
package main
import (
"bytes"
"compress/gzip"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"
@mpfund
mpfund / moz_xss.xml
Created May 9, 2015 12:19
moz_xss.xml
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="xss">
<implementation>
<constructor>
alert("xss");
</constructor>
</implementation>
</binding>
@mpfund
mpfund / strings.hs
Created April 14, 2015 19:36
find strings in files
import Data.ByteString.Lazy.Char8 as BS
import Data.Word
import Data.Bits
import Data.List
import Data.Char
import Data.List.Split
isChar x = o > 31 && o < 127 where o = ord x
scan::[Char]->[Char]->[Char]
@mpfund
mpfund / parsehtml.hs
Created April 14, 2015 05:31
parse html & links href
import Network.HTTP
import Text.HTML.TagSoup
openURL x = getResponseBody =<< simpleHTTP (getRequest x)
extractLinks ((TagOpen "a" as):xs) = as:extractLinks(xs)
extractLinks (x:xs) = extractLinks(xs)
extractLinks _ = []
extractHref (("href",k):xs) = k:extractHref(xs)
@mpfund
mpfund / prime_factors.html
Created March 10, 2015 16:43
Prime Factors
<script src="bignumber.js"></script>
<canvas id='c' width="200" height="200">
</canvas>
<script>
function prime_factors(n){
var factors = [];
var d = 2;
@mpfund
mpfund / findgzip.go
Created March 6, 2015 12:40
find gzip in streams
package main;
import (
"fmt"
"flag"
"bufio"
"os"
"compress/gzip"
"strconv"
"io"
@mpfund
mpfund / strings.go
Last active August 29, 2015 14:16
find_strings
package main;
import (
"fmt"
"flag"
"bufio"
"os"
"errors"
)
@mpfund
mpfund / find_png_in_dump.go
Last active August 29, 2015 14:16
find png in dump
package main
import (
"bufio"
"flag"
"fmt"
"image/png"
"io"
"os"
"strconv"