Skip to content

Instantly share code, notes, and snippets.

@tatac1
tatac1 / gist:5494055
Created May 1, 2013 06:47
install tag-soup
cabal install fast-tagsoup --extra-include=$(brew --prefix icu4c)/include --extra-lib-dirs=$(brew --prefix icu4c)/lib/
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Monad.Trans.Class (lift)
import Control.Monad.IO.Class
import Control.Monad.Trans.Control ()
import Data.Conduit
import Data.Conduit.Network
import Data.Conduit.Attoparsec
{-# LANGUAGE OverloadedStrings #-}
module ParsecRFC3164
(
parseRFC3164
, RFC3164
, PRI
, Severity
, Facility
, Header
module SyslogTypes where
data Priority =
DEBUG -- ^ Debug messages
| INFO -- ^ Information
| NOTICE -- ^ Normal runtime conditions
| WARNING -- ^ General Warnings
| ERROR -- ^ General Errors
| CRITICAL -- ^ Severe situations
| ALERT -- ^ Take immediate action
@tatac1
tatac1 / gist:5893560
Created June 30, 2013 02:34
Tanimoto coefficient
module Tanimoto where
import NLP.Scores
import Data.Set
a = fromAscList ['b','c','d','e']
i = fromAscList ['b','c','d']
main = do
jaccard a i
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 10 08:20:14 2013
@author: Nick Coblentz
"""
from burp import IBurpExtender
from burp import IScannerInsertionPointProvider
from burp import IScannerInsertionPoint
@tatac1
tatac1 / gist:8670611
Last active December 5, 2022 07:55
a http-conduit sample
{-# LANGUAGE OverloadedStrings #-}
import Network.HTTP.Conduit
import Network.HTTP.Types.Status
import Network
import Data.Time.Clock
import Data.Time.Calendar
import qualified Control.Exception as E
import qualified Data.ByteString.Lazy as L
past :: UTCTime
past = UTCTime (ModifiedJulianDay 56200) (secondsToDiffTime 0)
{-# LANGUAGE OverloadedStrings
, FlexibleContexts
, ScopedTypeVariables #-}
import ParsecRFC3164
import Data.Conduit.Network
import Data.Conduit
import Data.Conduit.Binary
import Data.ByteString (ByteString)
@tatac1
tatac1 / gist:9016280
Created February 15, 2014 08:39
tagstream and http-conduit combination
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Conduit.Binary as CB
import qualified Data.Conduit.List as CL
import qualified Text.HTML.TagStream.ByteString as TS
import Data.Conduit
import Network.HTTP.Conduit
main :: IO ()
main = do
@tatac1
tatac1 / gist:9090682
Last active August 29, 2015 13:56
install z3 v4.1.1 on Mac 10.9
$brew install gcc4.8
$brew install dos2unix
$git clone https://git01.codeplex.com/z3
$cd z3
$git checkout -b v4.1.1 refs/tags/v4.1.1
$autoconf
$./configure
$make -j8 CXX=g++-4.8 CC=gcc-4.8