19. September 2018

Javascript Post Request Twice

I went nuts yesterday. I’m trying to figure out why my click event is triggering twice. I have a modal with send button, that button has and click function to post data, for some reason the event triggers twice, using e.preventDefault() and e.stopPropagation() doesn’t work. It took me a while to find the answer. Using the code below, works for me. I hope it works for you too.

e.stopImmediatePropagation();

26. August 2018

Making your teminal prompt a little bit pretty

I use terminal a lot, it helps make work easier and faster. After using a Mac then moving to Ubuntu, I realized, that I couldn’t live without a Linux terminal. I wanted to customize my terminal prompt, so I looked into the internet and found oh-my-zsh, and looks pretty! lol!

zsh image

I wanted something like that, but, I don’t want to use ZSH, I want to stay in bash. Then I found bash_it. I don’t want to go and compare the two. but staying in bash, having a current path and git branch in my terminal prompt works for me. Bash_it has lots of plugins too and themes, I personally used ‘bobby theme’ and customized it to my needs.

my terminal

Installing bash_it
cd ~/
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
cd ~/.bash_it
sudo ./install.sh
To change theme

open your terminal, and nano into ~/.bash_profile or ~/.bashrc and look for this line.

# Lock and Load a custom theme file
# location /.bash_it/themes/
export BASH_IT_THEME='bobby'

If you don’t like my theme, visit bash_it themes for more options. Chow!

25. August 2018

How to setup html generated site into your hosting

This morning I finally had time to configure my new hosting in a2hosting.com. Did some configs on ssh access, git access, and etc… But what I really wanted to share is, how would you point your projectname/public folder to your public_html. We’re going to do this by linking public folder to public_html

SSH into your server.

ssh -p 22 username@domain.com

Folder structure should be something like this.

public_ftp/
public_html
www

In current directory, clone your project.

git clone https://yourname@bitbucket.org/yourname/blog.git blog
blog
public_ftp/
public_html
www

!Important: If you have something on public_html I would recommend to backing it up. Becase the next step that we will do is make sure that public_html is deleted.

mv ~/public_html ~/public_html_backup
ln -s ~/blog/public ~/public_html

That’s it! check your site www.yourdomain.com and to make sure everything works. If things are not working great, delete public_html and do the last step ln -s ~/blog/public ~/public_html. chow!— title: “How setup html generated site into your hosting” author: Arvind date: 2018-08-25

more