Blog Spot!


Ubuntu server out of box is not optimized to make full use of available hardware

Ubuntu server out of box is not optimized to make full use of available hardware. This means “out-of-box” setup might fail under high load.

So we need to tweak system configuration for maximum concurrancy.

easyengine

What limits the maximum number of connections on a Linux server?

serverfault

Added on 28.Sep.2016
Tags: server ubuntu optimize

Mathematical functions that calculate mean, median, mode, and range in javascript.

function mean(numbers) {
    // mean of [3, 5, 4, 4, 1, 1, 2, 3] is 2.875
    var total = 0,
        i;
    for (i = 0; i < numbers.length; i += 1) {
        total += numbers[i];
    }
    return total / numbers.length;
}

function median(numbers) {
    // median of [3, 5, 4, 4, 1, 1, 2, 3] = 3
    var median = 0,
        numsLen = numbers.length;
    numbers.sort();
    if (numsLen % 2 === 0) { // is even
        // average of two middle numbers
        median = (numbers[numsLen / 2 - 1] + numbers[numsLen / 2]) / 2;
    } else { // is odd
        // middle number only
        median = numbers[(numsLen - 1) / 2];
    }
    return median;
}

function mode(numbers) {
    // as result can be bimodal or multimodal,
    // the returned result is provided as an array
    // mode of [3, 5, 4, 4, 1, 1, 2, 3] = [1, 3, 4]
    var modes = [],
        count = [],
        i,
        number,
        maxIndex = 0;
    for (i = 0; i < numbers.length; i += 1) {
        number = numbers[i];
        count[number] = (count[number] || 0) + 1;
        if (count[number] > maxIndex) {
            maxIndex = count[number];
        }
    }
    for (i in count) if (count.hasOwnProperty(i)) {
        if (count[i] === maxIndex) {
            modes.push(Number(i));
        }
    }
    return modes;
}

function range(numbers) {
    // range of [3, 5, 4, 4, 1, 1, 2, 3] is [1, 5]
    numbers.sort();
    return [numbers[0], numbers[numbers.length - 1]];
}

sitepoint

Added on 20.Sep.2016
Tags: js math calculations

Awesome Slim micro-framework

A curated list of awesome tutorials and other resources for the Slim micro framework.

xssc/awesome-slim

Added on 09.Sep.2016
Tags: php slim framework awesome-list

Awesome PHP libraries, resources, good practices, and shiny things

A curated list of amazingly awesome PHP shiny things

ziadoz/awesome-php

Clean Code PHP

jupeter/clean-code-php

Modern PHP Cheat sheet

modern-php-cheatsheet

Secure PHP Web Applications and Prevent Attacks?

php-security-issues

Added on 09.Sep.2016
Tags: php info github clean code solid awesome-list

Broken Corrupted Raspberry Pi SD Card

fsck

Since most of the time you can fix broken file systems with an fsck, try..

$ sudo fsck /dev/mmcblk0p2

...if this fails continue here

10 Linux Fsck Command Examples to Check and Repair Filesystem

Added on 17.Aug.2016
Tags: pi fs card fix

Search


PHP Libraries


Carbon lib / docs
Idiorm lib / docs
Image Workshop lib / docs
lorenzos/Minixed lib / docs
Parsedown lib / docs
PHP Paginator lib / docs
PHP Redis lib / docs
QrCode lib / docs
Requests lib / docs
Slim lib / docs
Spyc lib / docs
TWIG lib / docs
Upload lib / docs
Validation lib / docs
Zebra Image lib / docs

JS Libraries


AJV lib / docs
BackboneJS lib / docs
Bootstrap Notify lib / docs
C3.js lib / docs
ChartJS lib / docs
FastMD5 lib / docs
HighlightJS lib / docs
jQuery-Storage lib / docs
JS-Cookie lib / docs
Leaflet JS lib / docs
LowDB lib / docs
Marked lib / docs
NeedlyJS lib / docs
ParcelJS lib / docs
RequireJS lib / docs
Swig lib / docs
Toastr lib / docs
Underscore lib / docs
ValidateJS lib / docs
top