Skip to content

Instantly share code, notes, and snippets.

View saleh-old's full-sized avatar

Saleh O saleh-old

View GitHub Profile
router.afterEach((to, from) => {
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
add it to the data:
isInViewPort: false
listen for scroll event:
this.$eventHub.$on('scrolled', this.setViewPort);
action:
/**
* is the element in view port
*
@saleh-old
saleh-old / node-cheat-sheat.sh
Last active February 7, 2019 14:56
Node useful commands that I keep forgetting
# To see where global packages (and which packages) are installed
npm list -g
# set new path for global packages:
mkdir ~/.global-modules
# add to ~/.npmrc:
npm config set prefix "~/.global-modules"
# then load it in ~/.zshrc:
export PATH=~/.global-modules/bin:$PATH
@saleh-old
saleh-old / install-node-ubuntu.sh
Last active April 3, 2019 07:14
commands to install latest LTS node on ubuntu 18.04
# update ubuntu
sudo apt update
# install nvm
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh
bash install_nvm.sh
source ~/.profile
# install node + npm
nvm install --lts
@saleh-old
saleh-old / oh-my-zsh-installation-ubuntu.sh
Created February 21, 2019 20:00
installation of Oh My Zsh on Ubuntu 18.04 LTS
apt-get install zsh
apt-get install git-core
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
# and then you change your shell to zsh
chsh -s `which zsh`
# and then restart
#sudo shutdown -r 0
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jesse BackTest",
"program": "${workspaceRoot}/node_modules/.bin/ts-node",
"args": ["${workspaceFolder}/index.ts"],
"protocol": "inspector",
@saleh-old
saleh-old / ubuntu-old-jesse.sh
Last active August 2, 2019 17:46
ubuntu setup for Jesse
sudo apt update
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh
bash install_nvm.sh
source ~/.profile
nvm install --lts
npm install jesse -g
snap install ffsend
apt install screen
apt-get install zsh
apt-get install git-core
# install
wget https://git.io/vpnsetup -O vpnsetup.sh && sudo sh vpnsetup.sh
# To add new users
wget -O add_vpn_user.sh https://raw.githubusercontent.com/hwdsl2/setup-ipsec-vpn/master/extras/add_vpn_user.sh
sudo sh add_vpn_user.sh 'username_to_add' 'password_to_add'
# For Android users, edit /etc/ipsec.conf and edit sha2-truncbug=yes to sha2-truncbug=no
# Clients are set to use Google Public DNS when the VPN is active.
# of course, skip steps that you already have done before
# update homebrew
brew update
# install php 7.3 (although +7.1 would do)
brew install php@7.3
# make sure php version is 7.3. On a new terminal tab run:
php -v
sudo apt-get update
# install Oh My Zsh
apt install zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# too add aliases
nano ~/.zshrc