Zebu https://github.com/modernserf/zebu
Constraints - Crista Lopes tagide.com/blog/research/constraints
Little Languages - Jon Bentley staff.um.edu.mt/afra1/seminar/little-languages.pdf
Purpose-Built Languages - Mike Shapiro
| Write a program that does what it’s supposed to do | |
| Write idiomatic code | |
| Debug a program that you wrote | |
| Debug a program someone else wrote | |
| Debug the interaction between a system you wrote and one you didn’t | |
| File a good bug report | |
| Modify a program you didn’t write | |
| Test a program you wrote | |
| Test a program you didn’t write | |
| Learn a new programming language |
| scala> case class Callback[A](f: (A => Unit) => Unit) { | |
| | def map[B](g: A => B): Callback[B] = Callback { (h: B => Unit) => f(a => h(g(a))) } | |
| | def flatMap[B](g: A => Callback[B]): Callback[B] = Callback { (h: B => Unit) => f(a => g(a).f(b => h(b))) } | |
| | } | |
| defined class Callback |
| // 6,046 bytes jarred. | |
| /* | |
| Copyright 2012 Viktor Klang | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
| #!/usr/bin/env ruby | |
| # | |
| # Convert blogger (blogspot) posts to jekyll posts | |
| # | |
| # Basic Usage | |
| # ----------- | |
| # | |
| # ./blogger_to_jekyll.rb feed_url | |
| # | |
| # where `feed_url` can have the following format: |
| #!/usr/bin/env ruby | |
| # | |
| # Convert blogger (blogspot) posts to jekyll posts | |
| # | |
| # Basic Usage | |
| # ----------- | |
| # | |
| # ./blogger_to_jekyll.rb feed_url | |
| # | |
| # where `feed_url` can have the following format: |
| import java.time.{LocalDateTime, ZoneId} | |
| import com.amazonaws.auth.{AWSCredentialsProvider, BasicAWSCredentials, InstanceProfileCredentialsProvider} | |
| import com.amazonaws.internal.StaticCredentialsProvider | |
| import com.amazonaws.util.IOUtils | |
| import com.sksamuel.elastic4s.ElasticsearchClientUri | |
| import com.sksamuel.elastic4s.http.{HttpClient, NoOpRequestConfigCallback} | |
| import io.ticofab.AwsSigner | |
| import org.apache.http.client.methods.HttpRequestWrapper | |
| import org.apache.http.impl.nio.client.HttpAsyncClientBuilder |
| import scala.slick.lifted.CanBeQueryCondition | |
| // optionally filter on a column with a supplied predicate | |
| case class MaybeFilter[X, Y](val query: scala.slick.lifted.Query[X, Y]) { | |
| def filter[T,R:CanBeQueryCondition](data: Option[T])(f: T => X => R) = { | |
| data.map(v => MaybeFilter(query.filter(f(v)))).getOrElse(this) | |
| } | |
| } | |
| // example use case | |
| import java.sql.Date |
| #!/usr/bin/env bash | |
| # | |
| # Script that detects if Scala's SBT is installed and if | |
| # not then it automatically downloads and installs it at | |
| # a specified path. | |
| # | |
| # Author: Alexandru Nedelcu (https://alexn.org) | |
| # | |
| set -e |
Zebu https://github.com/modernserf/zebu
Constraints - Crista Lopes tagide.com/blog/research/constraints
Little Languages - Jon Bentley staff.um.edu.mt/afra1/seminar/little-languages.pdf
Purpose-Built Languages - Mike Shapiro