Skip to content

Instantly share code, notes, and snippets.

View vasily802's full-sized avatar
:octocat:
What's happening?

vasily802

:octocat:
What's happening?
View GitHub Profile
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()

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.

@webdevilopers
webdevilopers / SubjectInsideFunctionAdmin.php
Last active February 14, 2023 14:07
How to use form event listener in Sonata Admin
<?php
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class SubjectOutsideFunctionAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
@lauris
lauris / ccToMap.scala
Created August 9, 2014 10:12
Convert case class to map in Scala
def ccToMap(cc: AnyRef) =
(Map[String, Any]() /: cc.getClass.getDeclaredFields) {
(a, f) =>
f.setAccessible(true)
a + (f.getName -> f.get(cc))
}
// Usage
case class Column(name: String,