Skip to content

Instantly share code, notes, and snippets.

@nkt
nkt / Results.md
Last active December 22, 2024 11:44
ReactPHP vs Node.js

wrk -t4 -c400 -d10s http://127.0.0.1:1337/

PHP

Running 10s test @ http://127.0.0.1:1337/
  4 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
 Latency 7.02ms 6.94ms 82.86ms 85.27%

```plantuml @startuml

Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response

@enduml ```

@nkt
nkt / test.md
Last active June 5, 2019 21:32

before text

  • before item
  • to do
  • done
  • after item
  • test
  • [] test after text
@nkt
nkt / server.conf
Created November 5, 2015 08:36
Nginx configuration for separated frontend and backend endpoints
upstream example-webpack {
server 127.0.0.1:8080;
}
upstream example-backend {
server 127.0.0.1:3000;
}
server {
listen 80;
@nkt
nkt / provision.sh
Created July 18, 2015 22:57
Ubuntu provisioning for Docker
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install wget -y
wget -qO- https://get.docker.com/ | sh
#import <React/RCTBridgeModule.h>
#import <React/RCTViewManager.h>
@interface RCT_EXTERN_MODULE(RNPhoneInputSwift, RCTViewManager)
RCT_EXPORT_VIEW_PROPERTY(value, NSString);
@end
@nkt
nkt / restify-joi-validation.js
Created May 17, 2015 15:16
Restify middleware for validation using Joi package
const {BadRequestError} = require('restify/lib/errors');
const Joi = require('joi');
module.exports = function validationPlugin() {
const fields = ['params', 'query', 'body'];
return function validationMiddleware(req, res, next) {
if (!req.route || !req.route.validate) {
return next();
}
/**
* Copyright 2017 dialog LLC <info@dlg.im>
* @flow
*/
import React, { PureComponent } from 'react';
type Props = {
className: string,
stream: MediaSource
/*
* Copyright 2017 dialog LLC <info@dlg.im>
* @flow
*/
/* eslint no-mixed-operators:0 */
type Config = {
start: number,
end: number,