Skip to content

Instantly share code, notes, and snippets.

@chitan
chitan / settings.json
Created May 3, 2019 13:27
VSCode_settings.json
{
"editor.fontSize": 17,
"terminal.integrated.fontSize": 15,
"editor.fontFamily": "Ricty",
"vim.insertModeKeyBindings": [
{
"before": ["j","j"],
"after": ["<Esc>"]
}
]
@chitan
chitan / WsChat.html
Last active July 27, 2024 04:26
How to use WebSocket of Tomcat7.0.52
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tomcat WebSocket Chat</title>
<script>
var ws = new WebSocket("ws://localhost:8080/WsChat/wschat");
ws.onopen = function(){
};
ws.onmessage = function(message){
#import <Foundation/Foundation.h>
#import "MyClass.h"
@interface ChildClass : MyClass
@end
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>getUserMedia for Firefox</title>
<script>
navigator.mozGetUserMedia(
{video:true},
function(stream) {
var video = document.getElementById("video");
@chitan
chitan / WsChatServlet.java
Created July 7, 2012 01:52
How to use WebSocket of Jetty
//This sample is how to use websocket of Jetty.
package wsapp;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.eclipse.jetty.websocket.WebSocket;
import org.eclipse.jetty.websocket.WebSocketServlet;
public class WsChatServlet extends WebSocketServlet {
@chitan
chitan / WsChatServlet.java
Created July 7, 2012 01:44
How to use WebSocket of Tomcat
//This sample is how to use websocket of Tomcat.
package wsapp;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.ArrayList;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;
@chitan
chitan / gist:2977339
Created June 23, 2012 07:25
HTML5 Base
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style></style>
</head>
<body>
</body>
</html>