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/bash | |
TAGS=$(git tag --list) | |
IFS=$'\n' read -rd '' -a TAGS_ARRAY <<<"$TAGS" | |
ARR_LENGTH="${#TAGS_ARRAY[@]}" | |
MOST_RECENT="${TAGS_ARRAY[ARR_LENGTH - 1]}" | |
printf "$MOST_RECENT\n" | |
jq '.builder = $version' --arg version "$MOST_RECENT" test.json > temp.test.json |
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
using System; | |
using Blackbaud.Registration.Tests.Common.Extensions; | |
using LanguageExt.UnitTesting; | |
using Xunit; | |
using static LanguageExt.Prelude; | |
namespace Blackbaud.Registration.MessageHandlers.UnitTests.CommandHandlers | |
{ | |
public class UsingApplyOnOption | |
{ |
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
/* | |
Modified from https://gist.github.com/dadhi/59cfc698f6dc6e31b722cd804aae185a | |
which was in turn modified from: https://gist.github.com/louthy/524fbe8965d3a2aae1b576cdd8e971e4 | |
Simplified to a program that adds two numbers | |
Useful links: | |
- [John DeGoes: Beyond Free Monads - λC Winter Retreat 2017](https://www.youtube.com/watch?v=A-lmrvsUi2Y) | |
- [Free and tagless compared - how not to commit to a monad too early](https://softwaremill.com/free-tagless-compared-how-not-to-commit-to-monad-too-early) |
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 Week04.Soln | |
( fun1 | |
, fun2 | |
, fun1' | |
, fun2' | |
, Tree(..) | |
, foldTree | |
, showTree | |
, printTree | |
, xor |
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 Week03.Golf | |
( skips | |
, localMaxima | |
, histogram | |
, histogramGen | |
) where | |
skips :: [a] -> [[a]] | |
skips xs = map (`everyNth` xs) [1..(length xs)] | |
where everyNth n = map snd . filter ((==0) . (`mod` n) . fst) . zip [1..] |
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
-- CIS 194 Homework 2 | |
module Week02.Log | |
( MessageType(..) | |
, TimeStamp | |
, LogMessage(..) | |
, MessageTree(..) | |
, testParse | |
, testWhatWentWrong | |
) 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
module Week01.CreditCardValidator | |
( toDigits | |
, toDigitsRev | |
, doubleEveryOther | |
, sumDigits | |
, validate | |
) where | |
reverseList :: [Integer] -> [Integer] | |
reverseList [] = [] |
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
/* | |
When you want to see the sql that entity framework is generating you | |
can turn on logging that will go to Visual Studios debug output | |
*/ | |
using(var dbContext = new MyDbContext()) | |
{ | |
dbContext.Database.Log = s => System.Diagnostics.Debug.WriteLine(s); | |
// do your queries here... | |
} |
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
-- POSTGRES SQL. | |
-- Count of rows where a timestamp column falls in interval. | |
-- This example uses a 5 minute interval ( 300 seconds = 5 minutes). | |
-- You need to replace the things inside square brackets, i.e. provide | |
-- the name of the table and timestamp column. | |
SELECT COUNT(*) cnt, | |
to_timestamp(floor((extract('epoch' from [Timestamp Column]) / 300 )) * 300) | |
AT TIME ZONE 'UTC' as expiry_interval | |
FROM [Table] GROUP BY expiry_interval | |
order by expiry_interval |
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
var truthTest = function(value){ | |
return value ? "true" : "false"; | |
} | |
// Boolean literals behave as expected | |
var trueLiteral = true; | |
var falseLiteral = false; | |
truthTest(trueLiteral); // true | |
truthTest(falseLiteral); // false |