Skip to content

Instantly share code, notes, and snippets.

@anhtuan3996
anhtuan3996 / http_streaming.md
Created May 5, 2021 02:26 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@anhtuan3996
anhtuan3996 / multiple_ssh_setting.md
Created March 17, 2021 02:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
ripple = require('ripple-lib')
/**
* PRODUCTION XRP Ledgrer : wss://s1.ripple.com:51233
*
* TEST NET SERVER: Test Net Server : wss://s.altnet.rippletest.net:51233
*
*/
const XRP_SERVER = 'wss://s.altnet.rippletest.net:51233'
@anhtuan3996
anhtuan3996 / gist:1b49dad2553d381521ff9ed6466131ae
Created December 14, 2020 04:41 — forked from Jeemusu/gist:7525186
Check if string is full-width Japanese. Useful when you need to validate a name field in Japanese.
function jpn_zenkaku_only($str) {
$encoding = "UTF-8";
// Get length of string
$len = mb_strlen($str, $encoding);
// Check each character
for ($i = 0; $i < $len; $i++) {
package fitnesse.html;
import fitnesse.responders.run.SuiteResponder; import fitnesse.wiki.*;
public class SetupTeardownIncluder { private PageData pageData;
private boolean isSuite;
private WikiPage testPage;
private StringBuffer newPageContent;
private PageCrawler pageCrawler;
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<ExposeHeader>ETag</ExposeHeader>
Here is the solution I went with. AWS AMI includes pip for installing Python applications. Here are the setup commands:
$ sudo pip install supervisor
$ echo_supervisord_conf
$ sudo su -
$ echo_supervisord_conf > /etc/supervisord.conf
After you install supervisor you will need to manually build your start-up script to turn the service on and off.
This will vary with your Linux distro, Ubuntu will create an init script for you when you install, other distros like AMI will not. Here is a great resource for various Linux distro init-up scripts:
const UserState = {
ACTIVE: 1,
INACTIVE: 2,
BLOCKED: 3,
EXPIRED: 4
};
Object.freeze(UserState);
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua and Barbuda
Argentina
Armenia
Australia
Austria
An Giang
Kon Tum
Bà Rịa – Vũng Tàu
Lai Châu
Bắc Giang
Lâm Đồng
Bắc Kạn
Lạng Sơn
Bạc Liêu
Lào Cai