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
| package features | |
| class FeatureConfigurator() extends FeatureConfiguratorMBean { | |
| val platformMBeanServer = ManagementFactory.getPlatformMBeanServer | |
| val objectName = new ObjectName("app:type=FeatureConfigurator") | |
| platformMBeanServer.registerMBean(this, objectName) | |
| def stop(): Unit = { | |
| platformMBeanServer.unregisterMBean(objectName) | |
| } | |
| def getFeatureLevel: String = ??? | |
| def setFeatureLevel(name: String): Unit = ??? |
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
| package features | |
| trait FeatureConfiguratorMBean { | |
| def getFeatureLevel: String | |
| def setFeatureLevel(name: String): Unit | |
| } |
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
| class AdvancedFeature(staticFeature: StaticFeature) | |
| extends Feature { | |
| def execute(inputXml: Elem): Future[Result] = { | |
| Future(blocking(AdvancedFeature.process(inputXml))) | |
| .recoverWith { | |
| case NonFatal(e) => staticFeature.execute(inputXml) | |
| } | |
| } | |
| } | |
| object AdvancedFeature { |
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
| class StaticFeature extends Feature { | |
| def execute(inputXml: Elem): Future[Result] = { | |
| Future.successful(StaticFeature.staticResult) | |
| } | |
| } | |
| object StaticFeature { | |
| val staticResult: Result = ??? | |
| } |
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
| trait Feature { | |
| def execute(inputXml: Elem): Future[Result] | |
| } |
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
| useradd -m work | |
| ln -s /home/work/config/nginx.work.conf /etc/nginx/conf.d/nginx.work.conf | |
| server { | |
| listen 80; | |
| listen 443 ssl http2; | |
| ssl on; | |
| ssl_certificate /etc/letsencrypt/live/git.work/fullchain.pem; | |
| ssl_certificate_key /etc/letsencrypt/live/git.work/privkey.pem; |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Git Watch</title> | |
| <style> | |
| body { | |
| font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif ; | |
| margin-left:7em; | |
| line-height:1.6; | |
| } |
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
| extends NotificationBroadcasterSupport | |
| val acn = new AttributeChangeNotification( | |
| this, | |
| ts, | |
| ts, | |
| "Msg", | |
| "Name", | |
| "String[]", | |
| oldValue, |
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
| Finding an ID for the current repository: | |
| ``` | |
| $ git remote -v | sed -E -n -e 's/^.*https:\/\/(github|bitbucket)[^/]+\/([^/]+)\/([^/]+)\.git \(fetch\)/\1\/\2\/\3/p' -e 's/^.*git@(github|bitbucket)[^:]+:([^/]+)\/(.*)\.git \(fetch\)/\1\/\2\/\3/p' | head -n 1 | |
| github/ScalaWilliam/git.watch | |
| ``` |
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
| libraryDependencies += "org.typelevel" %% "cats" % "0.6.0" | |
| libraryDependencies += "org.typelevel" %% "kittens" % "1.0.0-M3" |