Skip to content

Instantly share code, notes, and snippets.

Naing Lin Aung nainglinaung

View GitHub Profile
nainglinaung / Basic Gold Price Calculator
Created Apr 18, 2014
Calculation for Masses of Gold are different between International standard and Myanmar, we need own calculator for that and that's the example
View Basic Gold Price Calculator
# Declaration
mass = [];
def check_num num
raise(ArgumentError, "Put Numbers only") if /[[:alpha:]]/.match(num)
# Enter mass
puts "enter kyat, pyel, ywey with coma seperated value. 'x,y,z' "
input = gets
nainglinaung / gist:1a7f454e84d4990abd62
Last active Aug 29, 2015
The sum of number less than 1000 which is divisible by 3 or 5
View gist:1a7f454e84d4990abd62
console.log(Array.apply(null, Array(1000)).map((_, i)=>i+1).filter(v=> v%5==0||v%3==0).reduce((a,b)=>a+b));
View gist:6df799384fc71a2328af
var input = process.argv[2];
var DayDict = {'sun':6,'mon':15,'tue':8,'wed':17,'thu':19,'fri':21,'yar':12};
console.log((input in DayDict)? DayDict[input]*3-3:'invalid input');
View long-live-summon-list.js
var website = "";
// <a href="">Team</a>
var fs = require('fs');
var stream = fs.createWriteStream("my_file.txt");
stream.once('open', function(fd) {
for(i=1; i<465; i++) {
nainglinaung / aggrate.js
Created Jun 15, 2017
Change type in field
View aggrate.js
var devices = db.getCollection('devices').aggregate([
{ "$group" : {_id:"$something" } }
var batch = devices._batch;
for(i=0; i<=batch.length; i++) {
if (batch[i]) {
if (batch[i]._id) {
if (typeof(batch[i]._id) == 'number') {
View riddle.php
class Dog{
public function __call($_,Array $arguments)
echo $arguments[0];
nainglinaung / object-merger.js
Last active Dec 27, 2017
Javascript Object Merger with ES6
View object-merger.js
mergeObject: (obj1 = {}, obj2 = {}) => {
let ObjArray = [obj1,obj2];
let key1 = Object.keys(obj1);
let key2 = Object.keys(obj2);
let unionKeys = [ Set([...key1 ,...key2])];
let ignore = new Set(['createdAt','updatedAt','updated_at','_id']);
let result = {};
let keysMap = new Map();
unionKeys = new Set([...unionKeys].filter(x => !ignore.has(x)));
nainglinaung /
Created Jul 3, 2018 — forked from denji/
NGINX tuning for best performance

Moved to git repository:

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.

You can’t perform that action at this time.