Skip to content

Instantly share code, notes, and snippets.

@cn007b
cn007b / SuperSimpleRedisCircularBufferWrittenOnGO.md
Last active March 8, 2024 19:54
Super simple Redis circular-buffer written on GO

Super simple Redis circular-buffer on GO

Here you can find super simple redis based circular-buffer implementation written on golang:

package main

import (
	"fmt"
@cn007b
cn007b / benchmark.plainGoVsGin.md
Last active December 18, 2023 10:51
Plain Go vs Gin

Plain Go vs Gin

The aim of this benchmark is to answer the question do you need framework for your tiny microservice.

Prerequisites

Let's consider simple example where we need framework only to parse URL (someone may decide that it's sufficient reason to start use framework for tiny microservice).

@cn007b
cn007b / websockets.php
Last active June 20, 2023 23:17
Super simple PHP WebSocket example - websockets.php
<?php
$address = '0.0.0.0';
$port = 12345;
// Create WebSocket.
$server = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($server, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($server, $address, $port);
socket_listen($server);
@cn007b
cn007b / ports.json
Created May 5, 2023 05:31
ports.json
{
"AEAJM": {
"name": "Ajman",
"city": "Ajman",
"country": "United Arab Emirates",
"alias": [],
"regions": [],
"coordinates": [
55.5136433,
25.4052165
@cn007b
cn007b / fractal.md
Last active April 24, 2023 19:16
Simple fractal implementation on bash.

Simple bash fractal

Here you can find source code for simple fractal implementation
written in bash for hackerrank, which looks like this:

demo

Source code:

@cn007b
cn007b / swagger.json
Last active October 11, 2022 16:41
Simple swagger example
{
"swagger": "2.0",
"info": {
"description": "Test API swagger document.",
"version": "1.0.0",
"title": "Test API",
"contact": {
"email": "cn007b@gmail.com"
},
"license": {
@cn007b
cn007b / websockets.html
Created August 2, 2018 23:10
Super simple PHP WebSocket example - websockets.html
<html>
<body>
<div id="root"></div>
<script>
var host = 'ws://0.0.0.0:12345/websockets.php';
var socket = new WebSocket(host);
socket.onmessage = function(e) {
document.getElementById('root').innerHTML = e.data;
};
</script>
@cn007b
cn007b / README.md
Last active May 18, 2022 22:10
Apigee - AssignMessage Set Path

Apigee - AssignMessage Set Path

Here you can find apiproxy resources for AssignMessage > Set > Path examples.

More infor you can find here.

@cn007b
cn007b / tmp.sh
Last active March 4, 2022 08:05
tmp
swagger: "2.0"
info:
version: "1.0.0"
title: "API."
description: "API for dispatch lane and flow rack."
host: td.to-api.com
schemes:
- http
- https
basePath: "/v2"