Skip to content

Instantly share code, notes, and snippets.

View kyclark's full-sized avatar

Ken Youens-Clark kyclark

View GitHub Profile
module Todo where
import Data.List
import System.Directory (getHomeDirectory, doesFileExist)
import System.FilePath (combine)
import System.IO
main :: IO ()
main = do
home <- getHomeDirectory
import Json.Decode.Pipeline exposing (decode, required, optional, hardcoded)
import Json.Decode as JD
import Json.Decode.Extra as JDE
stringInt = JD.string |> JD.map String.toInt |> JD.andThen JDE.fromResult
type alias Person = { name : String, age : Int }
decoderPerson = decode Person
|> required "name" JD.string
-- TYPE MISMATCH -------------------------------------------------- src/Main.elm
The argument to function `layout` is causing a mismatch.
213| layout (Investigator id)
^^^^^^^^^^^^^^^
Function `layout` is expecting the argument to be:
ActivePage
-- TYPE MISMATCH -------------------------------------------------- src/Main.elm
The argument to function `Investigator` is causing a mismatch.
132| Investigator subModel)
^^^^^^^^
Function `Investigator` is expecting the argument to be:
Investigator.Model
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Random
main =
Html.program
{ init = init
my $out-file = $out || do {
my $ext = $in.IO.extension;
my $basename = $in.IO.basename.subst(/'.' $ext $/, '');
$*SPEC.catfile($in.IO.dirname, $basename ~ '.2.' ~ $ext);
};
#!/usr/bin/env perl6
use Bio::SeqIO;
sub MAIN (Str $file!, Int :$k=10) {
die "Not a file ($file)" unless $file.IO.f;
my $seqIO = Bio::SeqIO.new(format => 'fasta', file => $file);
my $j = -1 * ($k - 1);
@kyclark
kyclark / fasta2csv.pl
Last active August 29, 2015 14:07
FASTA to CSV
#!/usr/bin/env perl
use strict;
use warnings;
use autodie;
use feature 'say';
use Cwd 'cwd';
use File::Basename 'basename';
use File::Spec::Functions;
use File::Path 'mkpath';
@kyclark
kyclark / new-pl
Last active August 29, 2015 14:07
#!/usr/bin/env perl
=head1 NAME
new-pl - stub out a new Perl script
=head1 SYNOPSIS
new-pl <script-name-or-path> [description]