Skip to content

Instantly share code, notes, and snippets.

View valencik's full-sized avatar
🍍

Andrew Valencik valencik

🍍
View GitHub Profile
@ChristopherDavenport
ChristopherDavenport / EmojiEncoding.scala
Created September 20, 2021 23:13
Encode Emoji with Custom Embedding
import cats.syntax.all._
object EmojiEncoding {
private val range_min = 127744
private val range_max = 129782
private val range_min_2 = 126980
private val range_max_2 = 127569
private val range_min_3 = 169
@SystemFw
SystemFw / Ex.scala
Last active December 23, 2021 12:34
Update fields of a case class with a Diff generically, with support for nesting
object Ex {
import Lib._
case class Person(name: String, age: Int)
case class PersonOpt(name: Option[String], age: Option[Int])
def mergePerson(p: Person, po: PersonOpt) =
Person(po.name.getOrElse(p.name), po.age.getOrElse(p.age))
case class Contact(person: Person, phone: String)
@dacr
dacr / gatling-simple.sc
Last active April 2, 2023 10:12
Just ONE ammonite script file to execute a load performance test using gatling ! / published by https://github.com/dacr/code-examples-manager #ea7a4259-9461-44a8-99fa-1ec6ec3c48ed/6bc5335f1571c83edc6278c55499c9c7ae43a5c0
// summary : Just ONE ammonite script file to execute a load performance test using gatling !
// keywords : scala, gatling, ammonite, scala, load-test, performance
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : ea7a4259-9461-44a8-99fa-1ec6ec3c48ed
// created-on : 2018-09-22T07:41:07Z
// managed-by : https://github.com/dacr/code-examples-manager
// execution : scala ammonite script (http://ammonite.io/) - run as follow 'amm scriptname.sc'
@pathikrit
pathikrit / README.md
Last active April 24, 2021 17:36
My highly opinionated list of things needed to build an app in Scala

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@bigsnarfdude
bigsnarfdude / t-digetst.scala
Last active November 5, 2019 03:37
T-Digest in Scala Algebird Plus method
/**
* Example of T-Digest plus method with Algebird Semigroup
*/
import com.tdunning.math.stats.TDigest
import com.twitter.algebird.{Group, Semigroup}
import io.koff.t_digest._
case object TDigestSemigroup extends Semigroup[TDigest] {
anonymous
anonymous / README.md
Created September 25, 2015 22:08
Quick Gist: The self replicating chrome extension
  • Download this gist as a zip and extract
  • Open chrome://extensions
  • Enable Developer mode
  • Click Load unpacked extension... and select the extracted folder
  • 💵 Profit 💵

Created by the SMU CS Society

@jepio
jepio / minted.py
Last active September 18, 2023 13:58
Pandoc filter to use minted for syntax highlighting
#!/usr/bin/env python3
'''
Filter to wrap Pandoc's CodeBlocks into minted blocks when using latex.
Pandoc's `fence_code_attributes` can be used to provide:
- the language (first class)
- minted's argumentless options (following classes)
- minted's options with arguments (attributes)
'''
@xrstf
xrstf / setup.md
Last active October 3, 2022 13:30
Nutch 2.3 + ElasticSearch 1.4 + HBase 0.94 Setup

Info

This guide sets up a non-clustered Nutch crawler, which stores its data via HBase. We will not learn how to setup Hadoop et al., but just the bare minimum to crawl and index websites on a single machine.

Terms

  • Nutch - the crawler (fetches and parses websites)
  • HBase - filesystem storage for Nutch (Hadoop component, basically)
@mattes
mattes / call
Last active May 9, 2024 23:48
Place a call from terminal using your iPhone (Mac OS X Yosemite & iOS 8)
#!/usr/bin/env sh
open "tel://$*"