Skip to content

Instantly share code, notes, and snippets.

View tidusvn05's full-sized avatar

Tidusvn05 tidusvn05

View GitHub Profile
@tidusvn05
tidusvn05 / stringInvertCase.php
Last active September 17, 2022 11:59
String helpers in PHP
<?php
/**
* Uppercase to lowercase and lowercase to uppercase(ASCII string only).
*
* @param string $value
:x * @return string
*/
function invertCase($value)
{
@tidusvn05
tidusvn05 / stringStudlyCase.php
Created September 17, 2022 11:55
String helpers in PHP
<?php
/**
* Convert a value to studly caps case.
*
*
* @param string $value
* @return string StudlyCaseString
*/
function studlyCase($value)
@tidusvn05
tidusvn05 / stringInvertCase.php
Created September 17, 2022 11:54
String helpers in PHP
<?php
/**
* Uppercase to lowercase and lowercase to uppercase(ASCII string only).
*
* @param string $value
* @return string
*/
function invertCase($value)
{
@tidusvn05
tidusvn05 / stringInvertCase.php
Created September 17, 2022 11:52
String helpers in PHP
<?php
/**
* Uppercase to lowercase and lowercase to uppercase(ASCII string only).
*
* @param string $value
* @return string
*/
function invertCase($value)
{
@tidusvn05
tidusvn05 / stringInvertCase.php
Created September 17, 2022 11:51
String helpers in PHP
<?php
/**
* Uppercase to lowercase and lowercase to uppercase(ASCII string only).
*
* @param string $value
* @return string
*/
function invertCase($value)
{
@tidusvn05
tidusvn05 / stringInvertCase.php
Created September 17, 2022 11:50
String helpers in PHP
<?php
/**
* Uppercase to lowercase and lowercase to uppercase(ASCII string only).
*
* @param string $value
* @return string
*/
function invertCase($value)
{
@tidusvn05
tidusvn05 / aa.md
Created September 15, 2022 08:43
aaa

test

const web3 = web3Helper.getWeb3();
// For Fail transaction
const txFail = '0x0547db129efe2059939365fa4ab658559c51413f96134b5aaef3cf0b760a66ca';
const tranDetailFail = await web3.eth.getTransaction(txFail);
const receiptFail = await web3.eth.getTransactionReceipt(txFail);
console.log({ tranDetailFail, receiptFail });
// => Result log
@tidusvn05
tidusvn05 / nginx-tuning.md
Created March 11, 2019 17:00 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@tidusvn05
tidusvn05 / http
Created August 3, 2018 03:34
Nginx configuration snippet
server {
listen 80;
server_name domain;
location /alias_url {
root /var/www/alias_dir;
try_files $uri $uri/ =404;
}
# redirect to https