Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cboden's full-sized avatar
📉
Munging data

Chris Boden cboden

📉
Munging data
View GitHub Profile
@cboden
cboden / example.php
Last active February 11, 2024 14:38
Ratchet Routing
<?php
$collection = new RouteCollection;
$collection->add('chatRoom', new Route('/demo', array(
'_controller' => new ChatRoom
, 'allowedOrigins' => 'socketo.me'
)));
$collection->add('echo', new Route('/echo', array(
@cboden
cboden / MyApp1.php
Created June 19, 2012 12:43
TempRouter
<?php
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
class MyApp1 implements MessageComponentInterface {
public function onOpen(ConnectionInterface $conn) {
}
public function onMessage(ConnectionInterface $from, $msg) {
}
### Keybase proof
I hereby claim:
* I am cboden on github.
* I am cboden (https://keybase.io/cboden) on keybase.
* I have a public key ASCQUiRAweed0gO2oNk3LMp2o_oxwz9_ttmw_Fprr_tbRgo
To claim this, I am signing this object:
{
"rules": [
{"hello": "world", "foo": "bar"},
{"hello": "table?", "foo": "baz"},
{"hello": "Chris", "foo": "oof"}
]
}
@cboden
cboden / autobahn.js
Created March 31, 2017 14:37
Autobahn v1
/** @license MIT License (c) 2011,2012 Copyright Tavendo GmbH. */
/**
* AutobahnJS - http://autobahn.ws
*
* A lightweight implementation of
*
* WAMP (The WebSocket Application Messaging Protocol) - http://wamp.ws
*
* Provides asynchronous RPC/PubSub over WebSocket.
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
name ring quadrant isNew description
TypeScript Adopt languages-and-frameworks FALSE
NestJS Adopt languages-and-frameworks TRUE
LogDNA Trial Platforms TRUE
Airflow Trial Tools TRUE
Redash Trial Tools TRUE
Hookdeck Assess Tools TRUE
Heroku Adopt Platforms TRUE
Domain Driven Design Assess Techniques TRUE
Docker Adopt Tools TRUE
@cboden
cboden / certificate.pem
Created August 19, 2012 16:03
No Async SSL w/ PHP
-----BEGIN CERTIFICATE-----
MIIEFzCCAv+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBqMQswCQYDVQQGEwJkZTEP
MA0GA1UECBMGSGVzc2VuMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBM
dGQxEzARBgNVBAcTCkRpbGxlbmJ1cmcxEjAQBgNVBAMTCTEyNy4wLjAuMTAeFw0x
MjA2MTYyMDE2MDhaFw0yMjA2MTQyMDE2MDhaMGoxCzAJBgNVBAYTAmRlMQ8wDQYD
VQQIEwZIZXNzZW4xITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDET
MBEGA1UEBxMKRGlsbGVuYnVyZzESMBAGA1UEAxMJMTI3LjAuMC4xMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAofA7J9eN5Q8pTrbHOBQC63gB4m6NPNjx
NZ302U5VK5SIkT8lYNk/uwY88C93jAgEBjgSk9IcLdzCRIay5UJmf92fSwZS+x+7
V8nQyuMtQ+9uipX5nhFVAj1iGbO92McsuBb9ck1jQuNt5YZW1WsnGivh88vMiKBa
@cboden
cboden / proxy.php
Created April 3, 2017 20:39
Connect to a WS server forward msgs to self WS server
<?php
use Ratchet\ConnectionInterface;
require __DIR__ . '/vendor/autoload.php';
class Proxy implements \Ratchet\MessageComponentInterface {
private $clients;
public function __construct() {
$this->clients = new \SplObjectStorage;
curl http://localhost:5984/mydb/aSpecificDocId
// Take properties from aSpecificDocId which are keys for the following query
curl http://localhost:5984/mydb/_all_docs?keys=["docIdA","docIdB","docIdC","docIdD","docIdE"]