Skip to content

Instantly share code, notes, and snippets.

View virtualsafety's full-sized avatar

virtualsafety virtualsafety

View GitHub Profile
module AVLTree where
data BT = L | N Int BT BT deriving (Show, Eq)
-- Nice, small and useful functions
empty = L
-- You could say, depth L == Nothing depth (N v L L) == Just 0, but works for
-- me better this way:
depth L = 0
depth (N _ t u) = (max (depth t) (depth u)) + 1
module Main where
import Text.Parsec
import Text.Parsec.String
input_text :: String
input_text = "foo123:"
main :: IO ()
main = do
// Implementation of a UDP proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@virtualsafety
virtualsafety / ddns.go
Created December 24, 2012 14:23 — forked from hugozhu/ddns.go
package main
import (
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"strings"
"time"