Skip to content

Instantly share code, notes, and snippets.

Avatar
Hello World!

Hi girvan

Hello World!
  • US
View GitHub Profile
View Country Currency Code Mappings
Country,CountryCode,Currency,Code
New Zealand,NZ,New Zealand Dollars,NZD
Cook Islands,CK,New Zealand Dollars,NZD
Niue,NU,New Zealand Dollars,NZD
Pitcairn,PN,New Zealand Dollars,NZD
Tokelau,TK,New Zealand Dollars,NZD
Australian,AU,Australian Dollars,AUD
Christmas Island,CX,Australian Dollars,AUD
Cocos (Keeling) Islands,CC,Australian Dollars,AUD
Heard and Mc Donald Islands,HM,Australian Dollars,AUD
View restore-ulimit.sh
if grep -q 32768 /etc/security/limits.conf; then
sudo sed -i -e "/^.*nofile 32768$/d" /etc/security/limits.conf
sudo sed -i -e "/^.*nofile 65536$/d" /etc/security/limits.conf
else
echo skip /etc/security/limits.conf;
fi
if grep -q net.core.somaxconn /etc/sysctl.conf; then
sudo sed -i -e "/^net.core.somaxconn.*$/d" /etc/sysctl.conf
View modify-ulimit.sh
if grep -q 32768 /etc/security/limits.conf; then
echo skip /etc/security/limits.conf;
else
echo "* hard nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "* soft nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "root hard nofile 65536" | sudo tee -a /etc/security/limits.conf
echo "root soft nofile 65536" | sudo tee -a /etc/security/limits.conf
fi
@girvan
girvan / Common-Currency.json
Created Jun 22, 2016 — forked from Fluidbyte/Common-Currency.json
Common Currency Codes in JSON
View Common-Currency.json
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
View gist:645bfc9ab5e00a8bb37c4112fc908c09
240=>'240x320',
480=>'480x800',
540=>'540x960',
720=>'720x1280',
1080=>'1080x1920',
1440=>'1440x2560',
1536=>'1536x2048',
800=>'800x1280',
'wvga'=>'480x640',
'wxga'=>'800x1280',
@girvan
girvan / CDN_benchmark.md
Last active Oct 18, 2015
Cloudflare vs Cloudfront vs no CDN(US West) for each country
View CDN_benchmark.md

blog post: http://dev.sopili.net/2015/10/css-cloudfront-cloudflare-no-cdn.html

| TW | US | HK | SG | KR | BR | IN | JP | FR | GB | DE | RU ----|----|----|----|----|---|----|----|----|----|---|----|----|----|--- no CDN | 502 | 591 | 619 | 309 | 807 | 1118 | 11726 | 382 | 699 | 419 | 544 | 809 Cloudflare | 749 | 773 | 716 | 376 | 697 | 1363 | 1682 | 581 | 666 | 500 | 606 | 964 Cloudfront | 644 | 887 | 288 | 472 | 375 | 1524 | 1723 | 399 | 630 | 690 | 590 | 765

View dbchecker.php
<?php
$mysql_checker = function(){
$cfg = explode("\t", DB_CFG);
error_reporting(E_ERROR);
$try_num = 20;
$try_interval = 500000; // 0.5 sec
foreach(range(0, $try_num) as $times)
{
@girvan
girvan / preload.inc.php
Last active Aug 29, 2015
dbchecker file
View preload.inc.php
<?php
if(is_file('/home/wwwroot/dbchecker'))
require LIB_PATH . '/database/checker.php';
View 500.html
<!DOCTYPE html>
<html>
<meta charset="utf-8" />
<style type="text/css">
#main { font-family: arial; font-size:18px; }
#time { position:fixed; bottom:5px; right:5px; color:lightgray;}
</style>
<body>
<span id="time"></span>
<span id="main">Loading<span id="dot">.</span></span>
View nginx.conf
root /home/wwwroot;
+ error_page 500 502 503 504 /static/500.html;
You can’t perform that action at this time.