Skip to content

Instantly share code, notes, and snippets.

View odd's full-sized avatar
💭
Functioning

Odd Möller odd

💭
Functioning
View GitHub Profile
@kevinwright
kevinwright / scaladays2014.md
Last active November 16, 2024 17:40
Scaladays 2014 slides

As compiled by Kevin Wright a.k.a @thecoda

(executive producer of the movie, and I didn't even know it... clever huh?)

please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!

This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!

Monday June 16th

@elcinerkin
elcinerkin / tweetUp.adoc
Last active October 21, 2015 08:33 — forked from gromajus/food_recommendation_system.adoc
Location based meet-up recommendations for like minded people on Twitter

Location based meet-up recommendations for like minded people on Twitter

Inspiration

@viktorklang
viktorklang / Future-retry.scala
Last active July 23, 2023 23:48
Asynchronous retry for Future in Scala
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import akka.pattern.after
import akka.actor.Scheduler
/**
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown,
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure.

FOOD RECIPES RECOMMENDATION GRAPH

Inspiration

@ramn
ramn / PrimeGenerator.scala
Last active September 19, 2019 08:14
Prime generator in Scala
val primes: Stream[Int] = 2 #:: Stream.from(3).filter { n => !primes.takeWhile(_ <= math.sqrt(n)).exists(n % _ == 0) }
def isPrime(n: Int) = primes.dropWhile(_ < n).head == n
@qerub
qerub / ScalazLight.scala
Created December 18, 2013 23:07
Scalaz Light (The Good[^W]Indispensable Parts)
import scalaz._
trait ScalazLight
extends std.AllInstances
with syntax.std.ToOptionIdOps
with syntax.std.ToOptionOps
with syntax.ToEqualOps
with syntax.ToIdOps
@qerub
qerub / StringExtensions.scala
Created December 18, 2013 12:43
Bringing Perl's (main) regex operators to [Scala] (just for fun)
implicit class StringExtensions(val _value: String) extends AnyVal {
def =~(r: Regex): Boolean = _value match {
case `r`() => true
case `r`(xs @ _*) => throw new IllegalArgumentException("Regex must not contain captures")
case _ => false
}
def !~(r: Regex): Boolean = !(this =~ r)
}
@perival
perival / cg-meta-graph.adoc
Last active August 4, 2023 07:03
A Simple Meta-Data Model for a Graph Database - neo4j

A Simple Meta-Data Model for a Graph Database

Setting up a Meta-Data Framework

This GraphGist is a quick exploration of a simple meta-data administration which can be used to store the structure of the nodes and relationships in a graph database like neo4j.

The data that is set up here could be used in an application layer to provide tailored

@patriknw
patriknw / LoggingMailbox.scala
Last active January 5, 2023 08:12
Logs the mailbox size when exceeding the configured limit. Implemented in Scala and Java. Copy one of them to your project and define the configuration. This code is licensed under the Apache 2 license.
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.contrib.mailbox
import scala.concurrent.duration._
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicLong
import com.typesafe.config.Config
import akka.actor.{ ActorContext, ActorRef, ActorSystem, ExtendedActorSystem }
@phstc
phstc / gtk-firefox.sh
Created November 20, 2012 22:56
INSTALL FIREFOX ON AMAZON LINUX X86_64 COMPILING GTK+
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh