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
-- This is basically the same program taken from https://hackage.haskell.org/package/network-3.1.1.1/docs/Network-Socket.html#g:9 | |
-- on 2020-07-19 | |
-- It works as expected on Unix-like OSs: each line is buffered in and echoed back out | |
-- On Windows each character is read and echoed back out | |
module Lib where | |
import Control.Concurrent (forkFinally) |
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 Adventure where | |
import Control.Monad.State | |
import Data.Char | |
import Data.List | |
import System.IO | |
data Item | |
= Item | |
{ itemName :: String |
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 DeriveGeneric #-} | |
module SentinelFields1 where | |
{- | |
We have some JSON.. | |
[ | |
{ | |
"name": "Foo Test", |
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 DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE DuplicateRecordFields #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module Form where | |
import qualified Data.Aeson as JSON |
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
(ns clee.agealyzer) | |
(require '[clojure.java.io :as io]) | |
(defn date [x] (java.util.Date. x)) | |
(defn is-file? [f] (.isFile f)) | |
(defn last-modified [f] (.lastModified f)) | |
(defn get-year [x] (.getYear x)) | |
(defn process-dir |
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
git clone https://git.openstack.org/openstack-dev/devstack | |
cd devstack | |
cat << EOF > local.conf | |
[[local|localrc]] | |
HOST_IP=192.168.33.33 | |
PUBLIC_NETWORK_CIDR=10.0.1.0/24 | |
DEST=/opt/stack | |
DATA_DIR=/opt/stack/data | |
SCREEN_LOGDIR=/opt/stack/data/logs/ | |
LOGFILE=/opt/stack/data/logs/devstacklog.txt |
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
git clone https://git.openstack.org/openstack-dev/devstack | |
cd devstack | |
cat << EOF > local.conf | |
[[local|localrc]] | |
DEST=/opt/stack | |
DATA_DIR=/opt/stack/data | |
SCREEN_LOGDIR=/opt/stack/data/logs/ | |
LOGFILE=/opt/stack/data/logs/devstacklog.txt | |
VERBOSE=True | |
USE_SCREEN=True |
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
import sys | |
def main(args=()): | |
x, y = 0, 0 | |
total_presents = 1 | |
visited = {(0, 0),} | |
with open('3-1.txt') as f: | |
directions = f.read(256) | |
while directions: |
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
import sys | |
from collections import namedtuple | |
RightRectPrism = namedtuple('RightRectPrism', ('l', 'w', 'h')) | |
def parse_prism(s): | |
return RightRectPrism(*map(int, s.strip().split('x'))) |
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
function count_sloc | |
find . -name $argv | xargs cat | wc -l | |
end |
NewerOlder