Skip to content

Instantly share code, notes, and snippets.

@stanpalatnik
stanpalatnik / istio-fips-build.sh
Created October 4, 2023 15:33 — forked from jeesmon/istio-fips-build.sh
Istio FIPS Build
ISTIO_VERSION=${ISTIO_VERSION:-1.16.1}
git clone https://github.com/istio/proxy.git --depth 1
pushd proxy
git fetch --tags
git checkout "${ISTIO_VERSION}"
# Compile envoy with FIPS: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/security/ssl#fips-140-2
echo "build --define boringssl=fips" >> .bazelrc
BUILD_WITH_CONTAINER=1 make build_wasm build build_envoy exportcache

Keybase proof

I hereby claim:

  • I am stanpalatnik on github.
  • I am stanpal (https://keybase.io/stanpal) on keybase.
  • I have a public key ASB1JcDDpsiQMR9Vj7ogyY35woOI46gId3Q4wMpdb3vDjgo

To claim this, I am signing this object:

@stanpalatnik
stanpalatnik / ParquetToArrow.java
Created June 5, 2019 18:35 — forked from animeshtrivedi/ParquetToArrow.java
Example program to convert Apache Parquet data to Apache Arrow
/* This code snippet is a part of the blog at
https://github.com/animeshtrivedi/blog/blob/master/post/2017-12-26-arrow.md
*/
import com.google.common.collect.ImmutableList;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.*;
import org.apache.arrow.vector.dictionary.DictionaryProvider;
import org.apache.arrow.vector.types.FloatingPointPrecision;
import org.apache.arrow.vector.types.pojo.ArrowType;
$boxsize: 20;
$gutter: 5;
$x1: $boxsize + $gutter;
$x2: $x1 * 2;
$duration: 7;
.loader {
position: absolute;
top: 50%;
case class Summary(results: IndexedSeq[Sentence]) extends Traversable[String] {
lazy val charCount = if (results.isEmpty) 0 else results.map(_.sentence.size).sum
def foreach[U](f: String => U) {
results.foreach( s => f(s.sentence) )
}
def takeChars(limitCharCount: Int): Summary = {
var count = 0
import scala.annotation.tailrec
import scala.collection.mutable
object Euler02 extends App {
@tailrec
def fib(num: Int, prev: Int, result: mutable.Builder[Int, Vector[Int]] = Vector.newBuilder[Int]): Vector[Int] = {
num match {
case 0 => result.result()
case x if x > 4000000 => result.result()
import DbWrapper._
import scala.util.{Failure, Success, Try}
class Auctioneer {
/**
*
* @param item
* @return Boolean Whether or not the auction was successfully started
*/
def startAuction(item: Item): Boolean = {
@tailrec
def extractor[T](resultSet: ResultSet,
result: scala.collection.mutable.Builder[T, Vector[T]] = Vector.newBuilder[T])( process: ResultSet => T ): Vector[T] = {
if (!resultSet.next) result.result()
else {
val value = process(resultSet)
extractor(resultSet, result += value)(process)
}
}
detach { //this creates a new actor
completeWith { //we use a completeWith directive which respones with whatever we output at the end of the code block
var person = new Person();
person.address = getAddress(address['latitude'], address['longitude']).then((result) => person.address = result)
person.save
"saved!"
}
}