Skip to content

Instantly share code, notes, and snippets.

@dunithd
dunithd / JabberClient.java
Created Nov 1, 2010
Jabber client that connects to GTalk and sends a message
View JabberClient.java
package com.dunithd.jabber;
import org.jivesoftware.smack.*;
import org.jivesoftware.smack.packet.Message;
import java.util.Collection;
public class JabberClient {
public static void main(String[] args) {
View sample-dashboard.json
menuItems : [
{
"title" : "sdsd",
"childMenus" : [
{
"title" : "child-menu 01",
"tabs" : [
{ "title" : "some dumb title",
"description" : null,
"widgets" : [
View Todo_service_basic.bal
import ballerina/log;
import ballerina/http;
listener http:Listener todosListener = new(9090);
@http:ServiceConfig {
basePath: "/todos"
}
service TodoService on todosListener {
View Todo_service.bal
import ballerina/log;
import ballerina/http;
import ballerina/kubernetes;
@kubernetes:Service {
name : "todos",
serviceType: "LoadBalancer"
}
listener http:Listener todosListener = new(9090);
View TaskProcessorProxy.xml
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="TaskProcessorProxy" startOnLoad="true" transports="rabbitmq" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log level="custom">
<property expression="//Message/ID" name="[x] Message Received. ID: "/>
</log>
</inSequence>
<outSequence/>
<faultSequence/>
View cc-docker-compose.yml
---
version: '2'
services:
rabbitmq:
image: rabbitmq:3.7-management
container_name: rabbitmq
expose:
- 5672
- 15672
ports:
View DashboardWebSocket.java
package com.edu.retail.ws;
import io.quarkus.scheduler.Scheduled;
import javax.enterprise.context.ApplicationScoped;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
View dashboard.js
"use strict"
var connected = false;
var socket;
function connect() {
if (! connected) {
var clientId = generateClientId(6);
socket = new WebSocket("ws://" + location.host + "/dashboard/" + clientId);
socket.onopen = function() {
View account-service.yaml
asyncapi: 2.0.0
info:
title: Account Service
version: '1.0.0'
description: |
This service is responsible for managing user accounts in the system.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
View email-service.yaml
asyncapi: 2.0.0
info:
title: Email Service
version: '1.0.0'
description: |
This service is responsible for sending out emails upon certain events
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0