Skip to content

Instantly share code, notes, and snippets.

View imasif's full-sized avatar
🏠
Working from home

Md. Asif Khan imasif

🏠
Working from home
View GitHub Profile
@imasif
imasif / oh-my-zsh.sh
Last active August 29, 2015 14:07
How to install oh-my-zsh on Elementary OS #oh-my-zsh
# Install oh-my-zsh on Elementary OS
## We need curl, vim, git & zsh
### In Your Terminal:
$ sudo apt-get update
$ sudo apt-get install -y curl
$ sudo apt-get install -y vim
$ sudo apt-get install -y git
<!-- MockJax example with Bootstrap 3.2 -->
<script>
/**** MockJax to mock up an ajax response **/
$.mockjax({
url: '/like',
responseTime: 1000,
responseText: {
status: 'success',
@imasif
imasif / NodeJS multiple version management Linux or Mac
Last active September 12, 2019 06:52
NodeJS multiple version management Linux/Mac
1. We will be using 'n' for it. But before using `n` we need to install make;
$ sudo apt-get install make
2. Installing `n`:
$ curl -L https://git.io/n-install | bash
sets both PREFIX and N_PREFIX to $HOME/n, installs n to $HOME/n/bin,
modifies the initialization files of supported shells to export N_PREFIX and add $HOME/n/bin to the PATH,
and installs the latest stable node version.
3. . ~/.bashrc (reload .bashrc file)
@imasif
imasif / goto method declaration
Last active September 12, 2019 06:50
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
@imasif
imasif / node_manual.txt
Last active September 24, 2018 17:08
NodeManual
Add this code below ~/.bashrc file: export PATH=$HOME/local/bin:$PATH
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=$HOME/local
make install
curl -L https://www.npmjs.com/install.sh | sh
@imasif
imasif / bd mobile regex
Last active September 12, 2019 06:48
Bangladeshi mobile phone regex
bd_mobile_regex = /^(?:013|014|015|016|017|018|019)?(?:\d{8})$/;
(function ($) {
/* preloader */
$(window).on('load',function(){
$('#preloader').fadeOut('slow',function(){$(this).remove();});
});
/* latest-brand-curosel */
$('.latest-brand-curosel').owlCarousel({
loop:true,
@imasif
imasif / asound.conf
Created October 27, 2019 12:31
for using different mic and speaker for alsa in rasberrypi
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:<Card no>,<device no>"
}
@imasif
imasif / exportDB.sh
Last active June 22, 2020 13:57
Export mongodb database into JSON files, and import the JSON again.
#!/bin/bash
if [ ! $1 ]; then
echo " Example of use: $0 database_name dir_to_store"
exit 1
fi
db=$1
out_dir=$2
if [ ! $out_dir ]; then
out_dir="./"
@imasif
imasif / inject jquery from console
Created May 27, 2022 18:00
inject jquery from console
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();