Skip to content

Instantly share code, notes, and snippets.

View alirezas's full-sized avatar
🐢

Alireza Sarabchi alirezas

🐢
View GitHub Profile
wget http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable/deps
make hiredis jemalloc linenoise lua
cd ..
make install
sysctl vm.overcommit_memory=1
sysctl -w fs.file-max=100000
@alirezas
alirezas / index.js
Last active February 3, 2020 09:43
Iran National Code Validation
function validateNationalNumber(value) {
if (value == '0000000000' ||
value == '1111111111' ||
value == '2222222222' ||
value == '3333333333' ||
value == '4444444444' ||
value == '5555555555' ||
value == '6666666666' ||
value == '7777777777' ||
value == '8888888888' ||
// get the path of php.ini in command line
php --ini
// get the current memory limit
php -r "echo ini_get('memory_limit').PHP_EOL;"
// Temporary change memory limit for composer
php -d memory_limit = 1024M composer.phar
// Get the current permission of file
$base-font-size: 18px;
// Convert PX to EM
@function em($px, $bfs: $base-font-size){
@return ($px / $bfs) + 0em;
}
// Usage:
body {
font-size: em(24px);