Skip to content

Instantly share code, notes, and snippets.

View tyb's full-sized avatar
🤓
I may be slow to respond.

Taha Yavuz Bodur tyb

🤓
I may be slow to respond.
View GitHub Profile
@tyb
tyb / signalr_client.js
Created June 18, 2019 07:23
a signalR client
"use strict";
var connection = new signalR.HubConnectionBuilder().withUrl("/chatHub").build();
//Disable send button until connection is established
document.getElementById("sendButton").disabled = true;
connection.on("ReceiveMessage", function (user, message) {
var msg = message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
if (user == $("#userInput").val()) {
@tyb
tyb / bootstrap_and_razor.html
Created June 18, 2019 07:21
bootstrap & template engine(razor for example)
@page
@model IndexModel
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sohbet - SignalRExample</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
@Test
public void testReceive1() throws Exception {
receiver.addMessageListener("NotificationQueue");
sender.sendMessage("NotificationQueue", "bir mesaj gönderiliyor...queue.ya", null);
System.out.println("First style message send...");
TimeUnit.SECONDS.sleep(10);
//receiver.getLatch().await(10000, TimeUnit.MILLISECONDS);
@tyb
tyb / x
Created January 17, 2014 16:42
tyb gist
trial