This file contains 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
diff --git a/dynamodb/src/main/scala/io/atlassian/aws/dynamodb/DynamoDB.scala b/dynamodb/src/main/scala/io/atlassian/aws/dynamodb/DynamoDB.scala | |
index e87be02..8331411 100644 | |
--- a/dynamodb/src/main/scala/io/atlassian/aws/dynamodb/DynamoDB.scala | |
+++ b/dynamodb/src/main/scala/io/atlassian/aws/dynamodb/DynamoDB.scala | |
@@ -120,19 +120,7 @@ object DynamoDB { | |
def query[PK, V](ck: Column[PK], cv: Column[V])(q: QueryImpl): DynamoDBAction[Page[PK, V]] = | |
DynamoDBAction.withClient { | |
_.query(q.asQueryRequest) | |
- }.flatMap { res => | |
- DynamoDBAction.attempt { |
This file contains 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
trait Queries { | |
type K | |
trait Query { | |
def from(k: K): Query | |
} | |
def select(where: String) = Select(where) |
This file contains 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
#!/usr/bin/env bash | |
cat <<"EOF" | |
.-'"'-. | |
/ `. ,' \ | |
| ,' `. | | |
| ___ | | |
\ ( . ) / | |
'-.:.-' | |
.:. |
This file contains 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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad.Except | |
import Control.Monad.IO.Class () | |
import Control.Monad.Reader |
This file contains 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 scalaprops._ | |
/** Generate a permutation of the given values. | |
* | |
* > permute("ABC").sample | |
* Vector(A,C,B) | |
* > permute("ABC").sample | |
* Vector(B,A,C) | |
*/ | |
def permute[A](values: IndexedSeq[A]): Gen[IndexedSeq[A]] = |
This file contains 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
object Test extends App { | |
// From https://stackoverflow.com/a/6944070 | |
trait =!=[A, B] | |
implicit def neq[A, B] : A =!= B = null | |
// This pair excludes the A =:= B case | |
implicit def neqAmbig1[A] : A =!= A = null |
This file contains 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
TARGET=. | |
REPORT=/tmp/foo.sha | |
find $TARGET -type f -print0 | sort -z | xargs -0 sha1sum | tee >(sha1sum >> $REPORT) > $REPORT |
This file contains 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
sqlite> create table foo ( id int not null ); | |
sqlite> insert into foo values (1); | |
sqlite> insert into foo values (2); | |
sqlite> insert into foo values ("hello"); | |
sqlite> select * from foo; | |
1 | |
2 | |
hello |
This file contains 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
#!/bin/sh | |
# | |
# fixpacktepubs.sh | |
# | |
# Process the EPUB files in the current directory and recreate them with the | |
# ISBN as the unique value. This script was written because Packt Publishing | |
# sell EPUBs with non-unique unique identifiers and it assumes that the EPUBs | |
# being process are structured like Packt's. | |
# |
This file contains 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 Main | |
data Nt : Type where | |
Zn : Nt | |
Sn : Nt -> Nt | |
mutual | |
data Even : Nt -> Type where | |
EvenZn : Even Zn | |
EvenSn : Odd n -> Even (Sn n) |