Skip to content

Instantly share code, notes, and snippets.

S. Ali Mihandoost AliMD

View GitHub Profile
@AliMD
AliMD / server.js
Last active November 29, 2016 12:18
Nodejs Multi Cluster HTTP Server Example
"use strict";
let http = require('http');
let host = '127.0.0.1', port = 8080;
let cluster = require('cluster');
let numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
console.log(`Hey, I'm Master!`);
@AliMD
AliMD / android-accept-licenses.sh
Created November 14, 2016 07:32
Android Accept Licenses
#!/usr/bin/expect -f
set timeout 1800
set cmd [lindex $argv 0]
set licenses [lindex $argv 1]
spawn {*}$cmd
expect {
"Do you accept the license '*'*" {
exp_send "y\r"
@AliMD
AliMD / install-doceker.md
Last active October 24, 2023 07:30
Install docker on linux as easy as possible

Install Docker on linux

Any distribution of architecture as easy as possible.

# Install docker latest version from original website
curl -fsSL https://get.docker.com/ | sh

# Adding your user to the "docker" group
sudo usermod -aG docker $(whoami)
## you will have to log out and back in for this to take effect!
@AliMD
AliMD / docker.md
Last active June 8, 2020 11:19
Ali.MD Docker Learning Path
@AliMD
AliMD / .gitlab-ci.yml
Created July 17, 2016 05:05
Gitlab CI Build Configuration
# http://docs.gitlab.com/ce/ci/yaml/README.html
image: node:6
#services:
# - postgres
before_script:
- npm i
#after_script
@AliMD
AliMD / npm-config.md
Last active November 26, 2023 15:27
Optimize NPM for faster installing packages

AliMd npm config

Optimize NPM for faster installing packages

Strong recommended

npm config set registry http://registry.npmjs.org/
npm config set loglevel info
npm config set fetch-retries 3
npm config set fetch-retry-mintimeout 15000
npm config set fetch-retry-maxtimeout 90000
@AliMD
AliMD / screen size.txt
Created March 14, 2016 21:30
Popular screen size for responsive design
Width, Height
============= (0) phone max-4-col
* 360 -
414 -
* 480 480
============= (481) tablet or phone landscape max-8-col
* - 600
- 640
* - 720
- 736
@AliMD
AliMD / nexus-ota-updates-2016-02-01.md
Created February 7, 2016 10:45 — forked from jduck/nexus-ota-updates-2016-02-01.md
February 2016 Nexus OTA Updates - Security Level 2016-02-01
@AliMD
AliMD / .gitignore
Last active November 14, 2016 13:08
AliMD Git Ignore
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
# OSX
.DS_Store
._*
# Windows
Thumbs.db
Desktop.ini
@AliMD
AliMD / fix-persian-number.js
Last active August 10, 2022 19:16
Convert/Fix persian and arabic numbers inside a string to english in javascript, AliMD Edition ;)
(() => {
'use strict';
const
// Establish the root object, `window` (`self`) in the browser, `global`
// on the server, or `this` in some virtual machines. We use `self`
// instead of `window` for `WebWorker` support.
root = (() => {
if (typeof self == 'object' && self.self === self) return self;
else if (typeof global == 'object' && global.global === global) return global;