Skip to content

Instantly share code, notes, and snippets.

@thalamus
thalamus / ArchLinuxARM-M1
Last active March 11, 2024 16:55
How to boot Arch Linux ARM in QEMU (patched for M1)
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1)
Prerequisites:
QEMU - patched for M1 processors - patches: https://github.com/utmapp/qemu
@jdegoes
jdegoes / ZIO-1.0.0-RC-migration.md
Created March 4, 2020 12:44
Migration notes for ZIO-1.0.0-RC18

ZIO's last release candidate before 1.0 (RC18) has arrived!

The first question every user needs to ask themselves:

  • Should they upgrade now?
  • Should they wait for ZIO 1.0?

We need some adventurous souls to upgrade now, because the feedback so generated will help convince us we're ready to pull the trigger on ZIO 1.0 in a couple weeks time.

On the other hand, upgrading now is going to be more difficult, because not all ZIO libraries have been updated to RC18 (we are early in that process), and there is very poor documentation.

@ian-p-cooke
ian-p-cooke / add_wsl_exclusions.ps1
Last active November 12, 2022 05:02
powershell script to add WSL exclusions
$win_user = "ipc"
$linux_user = "ipc"
$package = "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc"
$base_path = "C:\Users\" + $win_user + "\AppData\Local\Packages\" + $package + "\LocalState\rootfs"
$dirs = @("\bin", "\sbin", "\usr\bin", "\usr\sbin", "\home\" + $linux_user + "\.cargo\bin")
$dirs | ForEach { Add-MpPreference -ExclusionProcess ($base_path + $_ + "\*") }
Add-MpPreference -ExclusionPath $base_path
@non
non / seeds.md
Last active April 12, 2024 09:18
Simple example of using seeds with ScalaCheck for deterministic property-based testing.

introduction

ScalaCheck 1.14.0 was just released with support for deterministic testing using seeds. Some folks have asked for examples, so I wanted to produce a Gist to help people use this feature.

simple example

These examples will assume the following imports:

@avnerbarr
avnerbarr / murmur64.scala
Created January 23, 2018 08:10
64bit "murmur" hash in scala. The builtin murmur hash only outputs 32 bits so if hashing millions of items you will get quite a few conflicts. This method will allow hashing millions of items without any conflicts
// Simple function to generate 64 bit hashes using the builtin Murmur hash functionaliy which only outputs 32bits
// we had cases when hashing 15M+ items where we got around 0.08% conflicts
// using this method we were able to hash 15M items with 0 conflicts
object ExtendedMurmurHash {
val seed = 0xf7ca7fd2
def hash(u: String): Long = {
val a = scala.util.hashing.MurmurHash3.stringHash(u, seed)
val b = scala.util.hashing.MurmurHash3.stringHash(u.reverse.toString, seed)
// shift a 32 bits to the left, leaving 32 lower bits zeroed
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@leonardofed
leonardofed / README.md
Last active May 3, 2024 01:24
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.


import cats.data.Xor
import io.circe.{ Decoder, Encoder, Error }
import io.circe.generic.semiauto._
import io.circe.jawn._
import io.circe.syntax._
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import scodec.{ Attempt, Codec, DecodeResult }
import scodec.codecs._
@alexandru
alexandru / task-proposal.md
Last active April 1, 2018 14:57
Task: A diverging design from Future and Scalaz Task
@milessabin
milessabin / gist:cadd73b7756fe4097ca0
Last active September 16, 2019 13:44
A new approach to encoding dependently-typed chained implicits, using singleton types ...
object Demo {
// A couple of type classes with type members ...
trait Foo[T] {
type A
}
object Foo {
implicit val fooIS = new Foo[Int] { type A = String }
}