Skip to content

Instantly share code, notes, and snippets.

View shameersn's full-sized avatar
😃
I am learning every day ...

Shameer S N shameersn

😃
I am learning every day ...
View GitHub Profile
@shameersn
shameersn / Kill a process listening on a port
Created January 20, 2021 06:11
Kill a process on Linux - listening a particular Port
To list any process listening to the port 8080:
lsof -i:8080
To kill any process listening to the port 8080:
kill $(lsof -t -i:8080)
or more violently:
kill -9 $(lsof -t -i:8080)
# Find the latest version on https://github.com/creationix/nvm#install-script
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Add in your ~/.zshrc the following:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ source ~/.zshrc
@shameersn
shameersn / VsCode custom log
Created April 6, 2018 04:22
VsCode custom console.log snippet
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1', $1);",
],
"description": "Log output to console"
}
@shameersn
shameersn / install-oh-my-zsh-on-ubuntu
Created August 22, 2017 10:18 — forked from richardtape/install-oh-my-zsh-on-ubuntu
Install Oh My ZSH on Ubuntu 14.04
# Where is the location of your current shall. Useful if we need to revert
echo $0
# Install ZSH
sudo apt-get install zsh
# Instal GIT
sudo apt-get install git-core
# Install OhMyZSH
@shameersn
shameersn / command.md
Created May 27, 2017 15:58
Browser sync installation and starting from Command line

npm install -g browser-sync

browser-sync start --server --files ".html, css/.css, js/*.js"

will serve the current directory at http://localhost:3000 with live reloading enabled for a basic html dev

@shameersn
shameersn / command.md
Created May 27, 2017 15:58
Browser sync installation and starting from Command line

npm install -g browser-sync

browser-sync start --server --files ".html, css/.css, js/*.js"

will serve the current directory at http://localhost:3000 with live reloading enabled for a basic html dev

@shameersn
shameersn / gulpfile.js
Created April 16, 2017 16:34 — forked from edouard-lopez/gulpfile.js
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com [R=301,L]
@shameersn
shameersn / gist:4317d7dc3d30bbb2c75a
Created January 16, 2016 05:07
How to prevent Right Click option using jquery and text selection
body {
-webkit-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
}
$(document).on("contextmenu", function (event) { event.preventDefault(); });
@shameersn
shameersn / gist:919084c3de2358eb2415
Created December 23, 2015 06:53
JQuery setting the selected attribute on a select list
If you don't mind modifying your HTML a little to include the value attribute of the options, you can significantly reduce the code necessary to do this:
<option>B</option>
to
<option value="B">B</option>
This will be helpful when you want to do something like:
<option value="IL">Illinois</option>