Skip to content

Instantly share code, notes, and snippets.

View dportabella's full-sized avatar

David Portabella dportabella

  • Lausanne, Switzerland
View GitHub Profile
@afrad
afrad / WracBaseTest.scala
Created May 2, 2016 18:33
Read and search common crawl wrac files directly from s3 using spark
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.io.LongWritable
import org.apache.spark.rdd.RDD
import org.apache.spark.{SerializableWritable, SparkConf, SparkContext}
import org.warcbase.io.WarcRecordWritable
import org.warcbase.mapreduce.WacWarcInputFormat
import org.warcbase.spark.archive.io.{ArchiveRecord, WarcRecord}
import org.warcbase.spark.rdd.RecordRDD._;
/**
@jackocnr
jackocnr / git-fs-history
Created March 3, 2014 01:54
Git filesize history (shell script)
#!/bin/sh
#
# list the given file's filesize next to each commit
# usage: git-fs-history path/to/file
#
if [ $# -ne 1 ]; then
echo "Error: invalid number of arguments."
exit 1
@mandubian
mandubian / CODE.scala
Last active September 30, 2021 20:03 — forked from playxamplez-admin/CODE
#Json #Reads/#Writes for a sealed #trait & inheriting caseclasses without type indication in Json #Play2.1
import play.api.libs.json._
import play.api.libs.functional.syntax._
sealed trait Shape
case class Circle(c: (Float, Float), r: Float) extends Shape
object Circle {
// reader is covariant and can be implicit in inheriting caseclasses
implicit val reader = Json.reads[Circle]
// writer is contravariant and can't be implicit in inheriting caseclasses
@kevinwright
kevinwright / ThrottledExecutionContext.scala
Last active October 5, 2018 08:09
Limit number of futures running in parallel (now updated with seize/release implementations suggested by roland)
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.atomic.AtomicInteger
import scala.concurrent.ExecutionContext
import scala.util.control.NonFatal
import scala.annotation.tailrec
//inspired by https://gist.github.com/viktorklang/4552423
object ThrottledExecutionContext {
def apply(maxConcurrents: Int)(implicit context: ExecutionContext): ExecutionContext = {
@AliMD
AliMD / gist:3344523
Created August 13, 2012 22:28
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@endolith
endolith / Has weird right-to-left characters.txt
Last active May 23, 2024 11:02
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶