This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import qualified Crypto.Hash.SHA1 as SHA1 | |
import qualified Data.Text as T | |
import qualified Data.Text.Encoding as TE | |
import qualified Data.ByteString as B | |
import qualified Text.Printf as P | |
import qualified Data.Word as W | |
import qualified Data.List.Split as S | |
import qualified Foreign as F |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <vector> | |
#include <ctime> | |
#include <random> | |
#include <hiredis/hiredis.h> | |
int main() { | |
const std::time_t now = std::time(NULL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import qualified Data.DateTime as DATE | |
import qualified Control.Monad as C | |
import qualified Control.Monad.Trans as CT | |
import qualified Database.Redis as R | |
import qualified System.Random as SR | |
import qualified Data.ByteString.UTF8 as U | |
import qualified Data.Vector as V |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import qualified Data.DateTime as DATE | |
import qualified Control.Monad as C | |
import qualified Control.Monad.Trans as CT | |
import qualified Database.Redis as R | |
import qualified System.Random as SR | |
import qualified Data.ByteString.UTF8 as U | |
-- a nice find from the web - picking an elt at random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$u = 4/0; | |
if ($u == $t) { | |
print "do stuff with *your* credit card number here\n"; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TupleSections #-} | |
module Main where | |
-- see https://plus.google.com/u/0/105746006385940131491/posts/9Uev6KVRUgK for | |
-- context | |
-- what we essentially have is a non-associative operation (represented by | |
-- concatenation): | |
-- | |
-- ab = ba = c | |
-- bc = cb = a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.List | |
import Data.List.Split | |
-- performs the transformation of adjacent strings | |
tr :: String -> String | |
tr s = case s of | |
"ab" -> "c" | |
"ba" -> "c" | |
"ac" -> "b" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Network.Wai | |
import Network.Wai.Handler.Warp | |
import Network.HTTP.Types | |
import qualified Data.Text as T | |
import Data.Time.Clock | |
import Data.Time.Format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// take an interface{} string and turn it into a real string | |
func To_S(i interface{}) (string,error) { | |
i_str,ok := i.(string) | |
if !ok { | |
e := fmt.Sprintf("cannot convert %v to string\n",i) | |
return "", errors.New(e) | |
} | |
return i_str,nil | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env gorun | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type MyJSONType struct { |