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 / gist:43bff1f920a4b2603f1a
Created June 18, 2015 14:17
LdnPHP Trivia June 17th, 2015
Language
- In the function strpos which comes first: the haystack or the needle?
haystack, needle
- What does the acronym "SPL" stand for?
Standard PHP Library
- Aside from inheriting these via genes, they're also good for horizontal code re-use
Traits
- Your only hope of implementing this interface is via Iterator or IteratorAggregate
Traversable
- SplStack and SplQueue both extend this common base class
@cboden
cboden / gist:0d21983e82ab0fb26c20
Created June 23, 2015 14:42
Operator Subject
var sub = new Rx.Subject();
var obs = sub.distinctUntilChanged(); // This is what I want
function module1(sub) {
sub.subscribe(console.log.bind(console));
sub.onNext('hello');
}
Rx.Observable.prototype.changes = function(deleteObs, keySelector) {
var source = this;
return new Rx.AnonymousObservable(function(observer) {
var store = new Map;
return new Rx.CompositeDisposable(
deleteObs.subscribe(function(key) {
var last = store.get(key);
store.delete(key);
@cboden
cboden / Disposable.php
Last active October 27, 2015 20:35
Observables
<?php
interface Disposable {
public function dispose();
}
@cboden
cboden / couch.sh
Created March 30, 2016 16:44
Bash CouchDB shortcut function
couch() {
curl -s "${@:2}" http://127.0.0.1:5984/$1 | json_pp
}
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"]
@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.
@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;
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
# 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
#