This file contains 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
public class MyApplication extends Application | |
{ | |
private Locale locale = null; | |
@Override | |
public void onConfigurationChanged(Configuration newConfig) | |
{ | |
super.onConfigurationChanged(newConfig); | |
if (locale != null) | |
{ |
This file contains 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
{ | |
"name": "My Composer Mirror", | |
"homepage": "http://localhost:4680", | |
"repositories": [ | |
{ "type": "vcs", "url": "https://github.com/SynetoNet/monolog" }, | |
{ "type": "composer", "url": "https://packagist.org" } | |
], | |
"require": { |
This file contains 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
{ | |
"repositories": [ | |
{ | |
"type": "composer", | |
"url": "http://localhost:4680" | |
} | |
{ | |
"packagist": false | |
} | |
] |
This file contains 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 di | |
import ( | |
"fmt" | |
) | |
func AverageScore() float64 { | |
score := getTotalScore() | |
member := getAllMember() | |
return float64(score / member) |
This file contains 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 PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>WebSocket Example</title> | |
</head> | |
<body> | |
<p>Messages:</p> | |
<div id="messages" style="width:800px;height:300px;overflow:scroll;"></div> |
This file contains 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 up1.demo; | |
import health.TemplateHealthCheck; | |
import io.dropwizard.Application; | |
import io.dropwizard.setup.Bootstrap; | |
import io.dropwizard.setup.Environment; | |
import resource.DemoResource; | |
public class DemoApplication extends Application<DemoConfiguration> { |
This file contains 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 | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"strings" | |
) |
This file contains 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 | |
import ( | |
"database/sql" | |
_ "github.com/go-sql-driver/mysql" | |
) | |
func main() { | |
db, err := sql.Open("mysql", "user1:user1password@/todo") | |
if err != nil { |
This file contains 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 | |
import ( | |
"html/template" | |
"os" | |
) | |
func main() { | |
t, err := template.New("foo").Parse(`{{define "T"}}Hello, {{.}}!{{end}}`) | |
err = t.ExecuteTemplate(os.Stdout, "T", "Up1") |
This file contains 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 size | |
func Size(a int) string { | |
switch { | |
case a < 0: | |
return "negative" | |
case a == 0: | |
return "zero" | |
case a < 10: | |
return "small" |