Skip to content

Instantly share code, notes, and snippets.

@fishyFrogFace
fishyFrogFace / Main.hs
Last active Apr 14, 2019
Read from file
View Main.hs
import System.Environment (getArgs)
doStuffToFile :: String -> IO ()
doStuffToFile str = print $ length str
-- alt1: "stack build" så "stack exec <projectname>-exe path-to-file-if-not-in-folder/bible.txt"
main :: IO ()
main = do
args <- getArgs
case args of
@fishyFrogFace
fishyFrogFace / parseEncoding.hs
Created Apr 13, 2019
Example of reading and writing to files with custom encoding
View parseEncoding.hs
import System.IO
import Control.Applicative (liftA)
import Data.Foldable (for_)
import Control.DeepSeq (($!!))
writeFileWithEncoding :: FilePath -> String -> IO ()
writeFileWithEncoding fp content =
withFile fp WriteMode $ \h ->
hSetEncoding h utf8 >>
hPutStr h content
@fishyFrogFace
fishyFrogFace / README-Template.md
Created Oct 20, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@fishyFrogFace
fishyFrogFace / CalendarView.java
Created Oct 1, 2016 — forked from james-d/CalendarView.java
Simple demo of creating a appointment-calendar like view (similar to the default calendar view in Google Calendar), in JavaFX 8. Just manages selection of time slots in the grid.
View CalendarView.java
package calendarview;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
You can’t perform that action at this time.