Skip to content

Instantly share code, notes, and snippets.

View ivanoronee's full-sized avatar

Ivan Orone ivanoronee

View GitHub Profile
implicit class JsPathMixin(path: JsPath) extends JsPath {
def readOrError[T](fieldMissingError: => String)(implicit r: Reads[T]): Reads[T] = (json: JsValue) => {
path.readNullable(r)
.reads(json) match {
case JsSuccess(Some(value), _) => JsSuccess(value, path)
case JsSuccess(None, _) => JsError(path, JsonValidationError(fieldMissingError))
case err@JsError(_) =>
err
}
}
@ivanoronee
ivanoronee / Install php 5.6 ubuntu 16
Created August 20, 2017 21:55 — forked from anhtuank7c/Install php 5.6 ubuntu 16
Install php 5.6 ubuntu 16
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
you can install more php5.6 module
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-intl php5.6-intl php5.6-mbstring php-apcu php-uuid php5.6-cgi php5.6-cli php5.6-gd php5.6-ldap php5.6-sqlite3 php-uploadprogress
import groovy.xml.*
def collection = [
[ key:'tim', value:null ],
[ key:'brenda', value:32 ]
]
def process = { binding, element ->
binding."${element.key}"( element.value )
}
ALTER DATABASE <database_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
SET GLOBAL innodb_file_format = barracuda;
set global innodb_large_prefix=on;
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod