This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER DATABASE <database_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | |
SET GLOBAL innodb_file_format = barracuda; | |
set global innodb_large_prefix=on; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.xml.* | |
def collection = [ | |
[ key:'tim', value:null ], | |
[ key:'brenda', value:32 ] | |
] | |
def process = { binding, element -> | |
binding."${element.key}"( element.value ) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} |