Skip to content

Instantly share code, notes, and snippets.

View miladr0's full-sized avatar
:octocat:

Milad Ranjbar miladr0

:octocat:
View GitHub Profile
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active February 28, 2024 00:27
Install v2ray on Bridge:(Ubuntu +18 via systemd) - Upstream (Ubuntu +18/CentOS +7 via docker)

پنل x-ui

پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور

mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
 -v $PWD/cert/:/root/cert/ \
@HairAndBeardGuy
HairAndBeardGuy / caddy-upstart-install.sh
Created July 15, 2017 13:34
Install Caddy Server on Ubuntu 14.04 with Upstart
apt install curl
curl https://getcaddy.com | bash -s cors,expires,filemanager,git,hugo,ipfilter,jsonp,jwt,locale,mailout,minify,multipass,prometheus,ratelimit,realip,search,upload
chown root:root /usr/local/bin/caddy
chmod 755 /usr/local/bin/caddy
setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
mkdir /etc/caddy
chown -R root:www-data /etc/caddy
mkdir /etc/ssl/caddy
chown -R www-data:root /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active April 22, 2024 08:04
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@davidrleonard
davidrleonard / execAsync.js
Last active November 29, 2022 03:42
Node exec async (with shell.js and bluebird)
const Promise = require('bluebird');
const sh = require('shelljs');
/**
* Asynchronously executes a shell command and returns a promise that resolves
* with the result.
*
* The `opts` object will be passed to shelljs's `exec()` and then to Node's native
* `child_process.exec()`. The most commonly used opts properties are:
*
@kaushikgopal
kaushikgopal / android_lifecycle_recommendations.md
Last active February 2, 2022 07:28
Notes on opportune moments to do "stuff" in the Android Lifecycle
  • In general you want to try and put things in onStart and onStop for logical start and stops.

Activity

onCreate

  • Dagger inject self into graph
  • setContentView(R.layout.xxx)
  • Butterknife.bind(this)
  • RxJava CompositeSubscription.add (if NON UI related work being done)
  • realm = Realm.getDefaultInstance();
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@irazasyed
irazasyed / how-to-install-phpmyadmin.md
Last active April 1, 2020 12:25
Tut: How to install/setup latest version of PHPMyAdmin on Ubuntu 12.04 LTS (Precise Pangolin)

How to install/setup latest version of PHPMyAdmin on Ubuntu 12.04 LTS (Precise Pangolin)

As the official installation packages of most linux distributions are usually totally out of date (but that’s pure intention, to provide extremely stable versions only) it might sense to install the latest version of certain package. Install the latest version of PHPMyAdmin via:

  1. Add this package-repository to your system.
sudo add-apt-repository ppa:nijel/phpmyadmin
@lancejpollard
lancejpollard / node-folder-structure-options.md
Created November 28, 2011 01:50
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin