Skip to content

Instantly share code, notes, and snippets.

S. Ali Mihandoost AliMD

View GitHub Profile
@AliMD
AliMD / map.geojson
Created August 17, 2013 10:13
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / .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 / 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 / .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 / 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!`);

Keybase proof

I hereby claim:

  • I am AliMD on github.
  • I am alimd (https://keybase.io/alimd) on keybase.
  • I have a public key whose fingerprint is 85CA 09B5 25C6 9C22 B722 5034 FF48 3EA7 EC96 CDA2

To claim this, I am signing this object:

@AliMD
AliMD / gist:3885209
Created October 13, 2012 16:21
Htaccess Password Protection

Password Protection

One of the many uses of the .htaccess is being able to reliably password protect directories on websites. Note: If you would like to use the cPanel tool to password protect your folders please see our article: Password Protect a folder on your website

The .htaccess File

Adding password protection to a directory using .htaccess takes two stages. The first part is to add the appropriate lines to your .htaccess file in the directory you would like to protect. Everything below this directory will be password protected:

AuthName "Secret Folder"
AuthType Basic
@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