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
type Connection struct { | |
socket io.ReadWriteCloser | |
listeners []chan []byte | |
outgoing chan []byte | |
} |
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
[jdiez@InfiniteImprobabilityDrive ~]$ openssl s_client -connect api.github.com:443 | |
CONNECTED(00000003) | |
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 High Assurance Server CA | |
verify error:num=20:unable to get local issuer certificate | |
verify return:0 | |
--- | |
Certificate chain | |
0 s:/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=*.github.com | |
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA | |
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA |
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
body { | |
font-family: "Open Sans", sans-serif; | |
} |
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
{ | |
"result": [ | |
{ | |
"hash": "7f40b49335b9", | |
"items": [ | |
{ | |
"compression": 1.0, | |
"extras": [], | |
"files": [ | |
{ |
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 Sudoku where | |
import Control.Monad (guard) | |
data Digit = D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | |
deriving (Eq, Ord, Read, Enum) | |
mkDigit :: Int -> Maybe Digit | |
mkDigit n | |
| n > 0 && n < 10 = Just $ toEnum (n-1) |
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 Sudoku where | |
import Control.Monad (sequence) | |
data Digit = D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | |
deriving (Eq, Ord, Read, Enum) | |
mkDigit :: Int -> Maybe Digit | |
mkDigit n | |
| n > 0 && n < 10 = Just $ toEnum (n-1) |
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 Sudoku where | |
import Data.List (intersperse, nub, transpose, (\\)) | |
import Control.Applicative ((<$>)) | |
import Control.Monad (sequence, mapM, guard) | |
data Position = Position Int Int | |
{- D0 is "Unknown" -} | |
data Digit = D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 |
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
itemsInSquare :: Sudoku -> Position -> [Digit] | |
itemsInSquare (Sudoku rows) (Position x y) = [y'..y'+2] >>= (\idx -> take 3 $ drop x' $ rows !! idx) | |
where x' = x - x `mod` 3 | |
y' = y - y `mod` 3 |
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 Sudoku where | |
import Data.List (intersperse, nub, transpose, (\\), minimumBy) | |
import Control.Applicative ((<$>)) | |
import Control.Monad (sequence, mapM, guard) | |
type Position = (Int, Int) | |
{- D0 is "Unknown" -} | |
data Digit = D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 |
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 Sudoku where | |
import Data.List (intersperse, nub, transpose, (\\), minimumBy) | |
import Control.Applicative ((<$>)) | |
import Control.Monad (sequence, mapM, guard) | |
type Position = (Int, Int) | |
{- D0 is "Unknown" -} | |
data Digit = D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 |