Skip to content

Instantly share code, notes, and snippets.

@cb372
cb372 / io-and-tf.md
Last active June 5, 2023 16:16
IO and tagless final

TL;DR

We should use a type parameter with a context bound (e.g. F[_]: Sync) in library code so users can choose their IO monad, but we should use a concrete IO monad in application code.

Abstracting over IO

If you're writing a library that makes use of effects, it makes sense to use the cats-effect type classes so users can choose their IO monad (IO, ZIO, Monix Task, etc).

So instead of

@jeroenr
jeroenr / Example.scala
Last active September 16, 2019 15:59
Json serializer / deserializer implementation for Kafka Streams based on Spray Json
sealed trait ApiModel
case class ClickData(
cid: String, // GA client id
timestamp: Option[Long]
) extends ApiModel
object ApiModel extends DefaultJsonProtocol {
implicit val ClickDataFormat = jsonFormat2(ClickData)
}
@dongjinleekr
dongjinleekr / consumer.sh
Last active August 5, 2024 08:44
Kafka benchmark commands
## Consumer Throughput: Single consumer thread, no compression
## Consumer Throughput: 3 consumer thread, no compression
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \
--messages 15000000 \
--threads 1
@0xjac
0xjac / private_fork.md
Last active March 15, 2025 04:48
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@patpohler
patpohler / Big List of Real Estate APIs.md
Last active February 28, 2025 21:53
Evolving list of Real Estate APIs by Category

Big List of Real Estate APIs

Listings / Property Data

####Rets Rabbit http://www.retsrabbit.com

Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.

@leonardofed
leonardofed / README.md
Last active March 14, 2025 18:19
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


What is this about?

Convert your ruby app to run on JRuby (often fairly painless) then deploy it by generating a JAR file (should be reasonably painless) and copying it to the servers you're running on (should be bordering on trivial).

If you've never done Java programming, a JAR is a "Java ARchive" file which is basically a single ZIP file containing all the stuff your app needs to run. So you can install java on a new machine and copy the JAR file onto it, and you're ready to go.

What's wrong with how we do it now?

The usual way of deploying a Ruby app is to write (or copypasta) some Capistrano recipes to have the production machines check it out from a git repo then build it in exactly the same way you do on your Mac. This has downsides:

@telent
telent / gist:9742059
Last active December 28, 2024 15:25
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet