Skip to content

Instantly share code, notes, and snippets.

View tmciver's full-sized avatar

Tim McIver tmciver

View GitHub Profile
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://purl.org/dc/terms/"
xmlns:j.1="http://www.kanzaki.com/ns/exif#"
xmlns:j.2="http://rdfs.org/sioc/ns#"
xmlns:j.3="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#"
xmlns:j.4="https://www.w3.org/ns/ldt/document-hierarchy#"
xmlns:j.5="http://xmlns.com/foaf/0.1/" >
<rdf:Description rdf:about="https://localhost:4443/files/aa9a03b9-9617-4990-acbf-cd33eed14d89/#iddf7b852c-37e9-4d82-94c6-699669232682">
<j.1:interoperabilityIndex rdf:resource="http://www.kanzaki.com/ns/exif#R98"/>
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about='/phone/upload/camera/20150331_180419.mp4'
xmlns:et='http://ns.exiftool.org/1.0/' et:toolkit='Image::ExifTool 12.40'
xmlns:ExifTool='http://ns.exiftool.org/ExifTool/1.0/'
xmlns:System='http://ns.exiftool.org/File/System/1.0/'
xmlns:File='http://ns.exiftool.org/File/1.0/'
xmlns:QuickTime='http://ns.exiftool.org/QuickTime/QuickTime/1.0/'
xmlns:UserData='http://ns.exiftool.org/QuickTime/UserData/1.0/'
networking.useDHCP = false;
networking.interfaces.enp0s31f6.useDHCP = false;
networking.interfaces.enp0s31f6.ipv4.addresses = [ {
address = "192.168.0.101";
prefixLength = 24;
} ];
import System.IO
import System.IO.Temp (withSystemTempFile)
f :: FilePath -> Handle -> IO ()
f fp h = do
hSetBuffering h NoBuffering
hPutStr h "Test"
contents <- hGetContents h
putStrLn ("contents is: " ++ contents)
@tmciver
tmciver / countStairs.hs
Created May 29, 2020 01:33
Both non-memoized and memoized verions of countStairs
import Data.Map as M
import Debug.Trace
import Data.Monoid ((<>))
-- non-memoized
countStairs :: Int -> Int
countStairs 0 = 1
countStairs 1 = 1
countStairs n = (countStairs (n-1)) + (countStairs (n-2))
@tmciver
tmciver / gist:6a79f4ac5f2659b4a9b1807a167bb589
Created March 30, 2020 20:44
Error from `spago build`
[info] Installing 4 dependencies.
[info] Searching for packages cache metadata..
[info] Recent packages cache metadata found, using it..
[info] Copying from global cache: "psci-support"
[info] Copying from global cache: "effect"
[info] Copying from global cache: "prelude"
[info] Copying from global cache: "console"
[info] Installation complete.
purs compile: No files found using pattern: src/**/*.purs
Compiling Type.Data.RowList
package com.timmciver.wordscapessolverweb
//import cats.effect.{Effect, IO, IOApp}
import cats.effect._
import cats.effect.implicits._
//import fs2.StreamApp
import scala.concurrent.ExecutionContext
import org.http4s.server.blaze.BlazeServerBuilder
sbt:wordscapes-solver-web> evicted
[info] Updating ...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn] * org.typelevel:cats-effect_2.12:1.2.0 is selected over {0.10.1, 0.10}
[warn] +- com.timmciver:wordscapes-solver_2.12:1.0 (depends on 1.2.0)
[warn] +- org.http4s:http4s-core_2.12:0.18.21 (depends on 0.10.1)
[warn] +- co.fs2:fs2-core_2.12:0.10.6 (depends on 0.10.1)
[warn] * org.typelevel:cats-core_2.12:1.5.0 is selected over {1.4.0, 1.0.1, 1.1.0}
package pipes
import cats.effect.IO
object Pipes extends App {
sealed trait Event
case class Harm(value: Int) extends Event
case class Heal(value: Int) extends Event
case object Quit extends Event
// import com.typesafe.sbt.web.SbtWeb
// import org.sbtidea.SbtIdeaPlugin._
// import play.twirl.sbt.Import.TwirlKeys
// import play.twirl.sbt.SbtTwirl
// import sbt.Keys._
// import sbt.{ExclusionRule, _}
lazy val main = (project in file("."))
.enablePlugins(PlayScala)
.enablePlugins(SbtWeb)