-
Idealized commit logs - the best talk IMO. Andrew Shreve shows his approach to better understanding of programs by using technique called program slicing - the idea is to decompose program and its tests in way that every 'commit' contains the smallest part of the code that makes included test pass. This way you get a history of program, which aims at incremental development of understanding. Awesome stuff. https://www.youtube.com/watch?v=dSqLt8BgbRQ&index=4&list=PLcGKfGEEONaDvuLDFFKRfzbsaBuVVXdYa
-
Clojure spec - the technique that is built into the language, allowing you to express the constraints over values as a part of function signature definition. Having those, you are able to validate, auto-document and auto-test (genertively) code. While its not a super innovative idea - it's interesting to see something like this to be implemented as a part of the language (i
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
(defn sha256 [string] | |
(let [digest (.digest (MessageDigest/getInstance "SHA-256") (.getBytes string "UTF-8"))] | |
(apply str (map (partial format "%02x") digest)))) |
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
pivot(_, [], [], []). | |
pivot(Pivot, [Head|Tail], [Head|LessOrEqualThan], GreaterThan) :- Pivot >= Head, pivot(Pivot, Tail, LessOrEqualThan, GreaterThan). | |
pivot(Pivot, [Head|Tail], LessOrEqualThan, [Head|GreaterThan]) :- pivot(Pivot, Tail, LessOrEqualThan, GreaterThan). | |
quicksort([], []). | |
quicksort([Head|Tail], Sorted) :- pivot(Head, Tail, List1, List2), quicksort(List1, SortedList1), quicksort(List2, SortedList2), append(SortedList1, [Head|SortedList2], Sorted). |
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
2 | 2016-11-08 | |
---|---|---|
12 | 2016-11-10 | |
2 | 2016-11-21 | |
2 | 2016-11-23 | |
20 | 2016-11-24 | |
10 | 2016-11-28 | |
7 | 2016-11-29 | |
1 | 2017-01-03 | |
20 | 2017-01-23 | |
8 | 2017-02-07 |
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 | |
"exec" "clojure" "-Sdeps" "{:deps | |
{clj-http {:mvn/version \"3.9.1\"} | |
org.seleniumhq.selenium/htmlunit-driver {:mvn/version \"2.34.0\"}}}" "$0" "$@" | |
;; usage | |
;; update/install clojure: brew install clojure | |
;; make the file executable: chmod +x | |
;; fill in below config values | |
;; run the file whenever you want |
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
for a in `heroku list -t omni | tail -n +2 | awk '{ print $1 }'`; do | |
count=`heroku ps -a $a --json | jq '[.[] | select(.type == "web")] | length' | tr -d '\n'` | |
if [ "$count" == "1" ]; then | |
heroku features:enable preboot -a $a | |
fi | |
done |
The introduction of Custom Runtimes has opened up new possibilities when it comes to the spectrum of languages that can be used in Amazon Lambda. This short document will show how to run virtually any statically linked binary on it. The example will cover a stack built Haskell project.
- Create an Amazon Linux instance compatible with Lambda, you can use
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
set -e | |
function callFastly() { | |
endpoint="$1" | |
shift | |
curl -f -s -H "Fastly-Key: ${FASTLY_TOKEN}" -H "Accept: application/json" "https://api.fastly.com$endpoint" $* | |
} | |
function getCurrentVersion() { | |
callFastly "/service/$SERVICE_ID/version" | jq '.[0].number' |
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
aws rds describe-db-instances | jq '.DBInstances[] | "" + .DBInstanceIdentifier + " " + .MasterUsername + " " + .Endpoint.Address' -r | grep pro > hosts |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:x="http://www.insert.com.pl/GTSchemas/ListaPlac.xsd" | |
xmlns:gttns="http://www.insert.com.pl/GTSchemas/Typy.xsd"> | |
<xsl:output method="xml" indent="yes"/> | |
<xsl:template match="/"> | |
<ListyPlac> | |
<xsl:apply-templates select="x:ListyPlac/x:ListaPlac" /> |
NewerOlder