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
if [ test-commands ]; then | |
#do something | |
elif [ more-commands ]; then | |
#do more something] | |
else | |
#do something else | |
fi |
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
version: "3.1" | |
services: | |
wordpress: | |
image: wordpress | |
ports: | |
- 8080:80 | |
environment: | |
WORDPRESS_DB_PASSWORD: password |
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
GET / controllers.Application.index() | |
GET /assets.javascript.ws.js controllers.Application.wsJs() | |
GET /wsInterface controllers.Application.wsInterface() |
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
// render index page | |
public static Result index() { | |
return ok(index.render()); | |
} |
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
// Websocket interface | |
public static WebSocket<String> wsInterface(){ | |
return new WebSocket<String>(){ | |
// called when websocket handshake is done | |
public void onReady(WebSocket.In<String> in, WebSocket.Out<String> out){ | |
SimpleChat.start(in, out); | |
} | |
}; | |
} |
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 models; | |
import play.mvc.*; | |
import play.libs.*; | |
import play.libs.F.*; | |
import java.util.*; | |
public class SimpleChat{ |
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
$(function(){ | |
// get websocket class, firefox has a different way to get it | |
var WS = window['MozWebSocket'] ? window['MozWebSocket'] : WebSocket; | |
// open pewpew with websocket | |
var socket = new WS('@routes.Application.wsInterface().webSocketURL(request)'); | |
var writeMessages = function(event){ | |
$('#socket-messages').prepend('<p>'+event.data+'</p>'); |
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
// get the ws.js script | |
public static Result wsJs() { | |
return ok(views.js.ws.render()); | |
} |
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
pngquant --ext .png --force *.png |
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
pngquant --quality=70-99 input.png -o output.png |
NewerOlder