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
import java.net.{ InetSocketAddress, Socket } | |
import java.time.Duration | |
import java.time.temporal.ChronoUnit.SECONDS | |
import java.util.concurrent.{ TimeUnit, TimeoutException } | |
import java.util.function.{ Consumer, Predicate } | |
import com.dimafeng.testcontainers.{ Container, GenericContainer } | |
import com.faunadb.client.FaunaClient | |
import org.junit.runner.Description |
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
**************************************************************************** | |
**** FaunaDB Relations: GraphQL schemas, mutations and resulting documents * | |
**************************************************************************** | |
**** One to One Relation *************************************************** | |
SCHEMA: | |
type User { name: String! car: Car } | |
type Car { plate: String! owner: User } | |
MUTATION: | |
mutation Create { | |
createUser(data: { |
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
git format-patch HEAD~X --stdout > patch | |
git apply --stat patch | |
git apply --reject --whitespace=fix patch |
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
import spark.implicits._ | |
import org.apache.spark.sql.functions.udf | |
import org.apache.spark.sql._ | |
import org.apache.spark.sql.functions._ | |
import org.apache.spark.sql.execution.debug._ | |
val u = udf((a: Int) => a) | |
val df = spark.sparkContext.parallelize(Seq(0)).toDF("0") | |
val res = (1 until 20).foldLeft(df) { case (d, 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
package rs | |
import scala.language.higherKinds | |
import matryoshka.data._ | |
import matryoshka.implicits._ | |
import scalaz._, Scalaz._ | |
trait Expr[A] | |
case class NumLit[A](value: Int) extends Expr[A] |
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
files: | |
"/etc/init/eb-docker-iptables.conf": | |
mode: "000644" | |
content: | | |
description "Elastic Beanstalk Default Docker Container Iptables" | |
author "Matthew Tovbin <[email protected]>" | |
start on started docker | |
stop on stopping docker |
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
task classpath << { | |
description 'Print project classpath.' | |
println sourceSets.main.runtimeClasspath.asPath | |
} |
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
cd /proc/<pid> && echo -n "Max open files=65535:65535" > limits |
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
import java.io.IOException | |
import java.nio.ByteBuffer | |
import java.nio.channels.{AsynchronousFileChannel, CompletionHandler} | |
import java.nio.file.Paths | |
import java.nio.file.StandardOpenOption._ | |
import scala.concurrent.{ExecutionContext, Future, Promise} | |
import scala.util.Try | |
/** |
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
import socket, select | |
s1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s1.bind(('localhost', 8125)) | |
s2 = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_UDP) | |
s2.bind(('localhost', 8125)) | |
while True: | |
r, w, x = select.select([s1, s2], [], []) | |
for i in r: | |
print i, i.recvfrom(131072) |
NewerOlder