Skip to content

Instantly share code, notes, and snippets.

Avatar
😘
Taking care of my daugther

Nepomuk Seiler muuki88

😘
Taking care of my daugther
View GitHub Profile
@mishriky
mishriky / ResilientClientSamples.scala
Created Feb 7, 2017
Samples for Finagle Client Configuration
View ResilientClientSamples.scala
/**
* This is not meant to cover ALL possible ways of creating service clients; instead it focuses on the simplest way to
* do so, while maintaining the capability to customize the clients based on service level agreements/expectations
*
* @note Most of the filters can be applied to the HTTP client as well but have been omitted from the sample code to improve
* readability
*/
trait ClientSamples extends LazyLogging {
private[this] lazy val config = ConfigFactory.load()
@cb372
cb372 / jargon.md
Last active Jul 28, 2021
Category theory jargon cheat sheet
View jargon.md

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@rklaehn
rklaehn / Client example
Last active Jun 8, 2020
akka http file server
View Client example
package akkahttptest
import akka.http.Http
import akka.stream.ActorFlowMaterializer
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Sink, Source}
import akka.http.model._
object TestClient extends App {
@davidallsopp
davidallsopp / Shrinking.scala
Last active Aug 21, 2021
Solutions to the ScalaCheck problem that shrinking failing values may generate invalid values, because the constraints of the generator are not respected. This is for using ScalaCheck from within ScalaTest.
View Shrinking.scala
import org.scalatest._
import prop._
import org.scalacheck.Arbitrary._
import org.scalacheck.Gen
/**
* Solutions to the ScalaCheck problem that shrinking failing values may generate
* invalid values, because the constraints of the generator are not respected.
*
* See also http://stackoverflow.com/questions/20037900/scalacheck-wont-properly-report-the-failing-case
@kevinwright
kevinwright / scaladays2014.md
Last active Mar 8, 2018
Scaladays 2014 slides
View scaladays2014.md

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

@tcurdt
tcurdt / ant
Last active Jun 19, 2018
towards the jdeb 2.0 syntax
View ant
<target name="package" depends="jar">
<taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask"/>
<deb destfile="${build.dir}/${ant.project.name}.deb" verbose="true">
<control>
<package>(no default)</package>
<version>(no default)</version>
<section>(default 'misc')</section>
<priority>(default 'low')</priority>
<architecture>(default 'all')</architecture>
@fappel
fappel / mockito-templates.xml
Created Feb 7, 2014
Mockito Templates for Eclipse
View mockito-templates.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="java-statements" deleted="false" description="Mockito doAnswer(answer).when(mock).call() construct" enabled="true" name="doAnswer">${a:importStatic(org.mockito.Mockito.doAnswer)}${b:import(org.mockito.stubbing.Answer, org.mockito.invocation.InvocationOnMock, java.lang.Throwable)}doAnswer( new Answer&lt;${T}&gt;() {&#13;
public ${T} answer( InvocationOnMock invocation ) throws Throwable {&#13;
${cursor}&#13;
return null;&#13;
}&#13;
} ).when( ${mock} ).${call};</template><template autoinsert="false" context="java-statements" deleted="false" description="Mockito doAnswer(answer).when(mock).call() construct that manipulates invocation argument" enabled="true" name="doAnswerOnArgument">${a:importStatic(org.mockito.Mockito.doAnswer)}${b:import(org.mockito.stubbing.Answer, org.mockito.invocation.InvocationOnMock, java.lang.Throwable)}doAnswer( new Answer&lt;${T}&gt;() {&#13;
public ${T} answer( InvocationOn
@eamelink
eamelink / iteratees-by-example.scala
Created May 23, 2013
Scala-IDE worksheet with some examples of iteratees, enumerators and enumeratees and how to use and compose them. Originated from a presentation at Dutch Scala Enthusiasts.
View iteratees-by-example.scala
import play.api.libs.iteratee._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
import scala.concurrent.duration._
import play.api.libs.concurrent.Promise
object iteratees {
// Implicit conversion to add 'await' to a Future
implicit class WFuture[A](val inner: Future[A]) extends AnyVal {
@thisboyiscrazy
thisboyiscrazy / angularjs-button-loading.js
Created Mar 11, 2013
Angularjs button loading like twitter bootstraps e.g. <button btn-loading="something.busy" data-loading="I'm working on it...">Do It</button>
View angularjs-button-loading.js
angular.module('ui.bootstrap.buttons', [])
.directive('btnLoading',function () {
return {
link:function (scope, element, attrs) {
scope.$watch(
function () {
return scope.$eval(attrs.btnLoading);
},
function (value) {
@xseignard
xseignard / pom.xml
Created Jul 3, 2012
upload p2 repo
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2010, 2011 SAP AG and others. All rights reserved. This
program and the accompanying materials are made available under the terms
of the Eclipse Public License v1.0 which accompanies this distribution, and
is available at http://www.eclipse.org/legal/epl-v10.html Contributors: SAP
AG - initial API and implementation -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>