Skip to content

Instantly share code, notes, and snippets.

View padurean's full-sized avatar

Valentin Padurean (Ogg) padurean

View GitHub Profile
@padurean
padurean / AnyController.scala
Last active August 29, 2015 14:21
Play 2 request logging using composed actions
// Actions in controllers will be defined like this:
def create = ComposedAction.async(parse.tolerantJson) { implicit request => ... }
// instead of this:
def create = Action.async(parse.tolerantJson) { implicit request => ... }
@padurean
padurean / gist:241dfab0a83ab9125f14
Created June 29, 2015 10:12
Git commit message format - recommended by Linus Torvalds
Please write good git commit messages. A good commit message
looks like this:
Header line: explain the commit in one line (use the imperative)
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.
The body of the commit message can be several paragraphs, and
@padurean
padurean / Play_WS_Standalone_HowTo.md
Last active July 8, 2016 14:25 — forked from cdimascio/Play_WS_Standalone_HowTo.md
PlatWS - How to use it in standalone Scala app

This gist provides a simple example of how to use Play's WS library in a standalone application (external to Play).

build.sbt - SBT build file that includes the WS library WSStandaloneTest.scala - A simple example that utilizes WS to invoke an HTTP GET request

@padurean
padurean / Scala-SBT-Pass-JVM-Options-To-Test.md
Last active May 21, 2022 14:47
SBT, Scala - Pass JVM options when running tests

Use javaOptions sbt setting in Build.scala or build.sbt to pass jvm options to tests e.g.

  • statically:
javaOptions in Test ++= Seq("-Dconfig.file=conf/staging.conf")

or

@padurean
padurean / AboutFinch.md
Last active December 22, 2015 11:56
Zipkin tracing in Finch

padurean 12:52 Hi, guys I am new here, working in Scala & Play currently but i want to start a project using Finch and i would like to know if i can use Finagle modules with Finch and how - for example the Zipkin module (which i can not find between Finch modules)

thanks in advance

P.S. a link to some article describing this should be enough

padurean 12:53

{-
See Elm docs for more details:
http://elm-lang.org/docs/records#record-types
-}
import Html
import String
origin : { x : Float, y : Float }
origin =
{ x = 0
@padurean
padurean / destructuring.md
Created April 6, 2016 13:46 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))

let
  (a,b,c) = myTuple

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@padurean
padurean / index.md
Created September 22, 2016 17:04 — forked from alekseykulikov/index.md
SUIT CSS naming convention for React.js application

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 6561 lines of CSS (and just 5 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers: