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
| [Unit] | |
| Description=Sleep Service | |
| Requires=docker.service | |
| # Dependency ordering | |
| After=docker.service | |
| [Service] | |
| Restart=always | |
| ExecStartPre=-/usr/bin/docker rm %p |
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
| type Number float64 | |
| func (n *Number) Increase() { | |
| *n++ | |
| } | |
| func (n *Number) Decrease() { | |
| *n-- | |
| } |
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
| // https://play.golang.org/p/zu7mtEWy7e | |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "math/rand" | |
| "os" |
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 main | |
| type ( | |
| ListKey string | |
| ListVal interface{} | |
| ) | |
| type ArrayList struct { | |
| list map[ListKey]ListVal | |
| } |
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
| // Sorts by weight | |
| $data = array( | |
| array( | |
| 'language' => 'PHP', | |
| 'weight' => 50, | |
| ), | |
| array( | |
| 'language' => 'Java', | |
| 'weight' => 20, |
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 RegexRouter | |
| { | |
| private $routes = array(); | |
| public function addRoute($route, callable $service) | |
| { | |
| $route = '#^'.$route.'$#'; | |
| $this->routes[$route] = $service; | |
| return $this; | |
| } |
NewerOlder