Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Md. Asif Khan imasif

🏠
Working from home
View GitHub Profile
@imasif
imasif / exportDB.sh
Last active Jun 22, 2020
Export mongodb database into JSON files, and import the JSON again.
View exportDB.sh
#!/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 / asound.conf
Created Oct 27, 2019
for using different mic and speaker for alsa in rasberrypi
View asound.conf
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:<Card no>,<device no>"
}
View main.js
(function ($) {
/* preloader */
$(window).on('load',function(){
$('#preloader').fadeOut('slow',function(){$(this).remove();});
});
/* latest-brand-curosel */
$('.latest-brand-curosel').owlCarousel({
loop:true,
@imasif
imasif / bd mobile regex
Last active Sep 12, 2019
Bangladeshi mobile phone regex
View bd mobile regex
bd_mobile_regex = /^(?:013|014|015|016|017|018|019)?(?:\d{8})$/;
View node_manual.txt
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 / goto method declaration
Last active Sep 12, 2019
Add mouse click `goto definition` in sublime text 3.
View goto method declaration
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 / NodeJS multiple version management Linux or Mac
Last active Sep 12, 2019
NodeJS multiple version management Linux/Mac
View NodeJS multiple version management Linux or 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)
View gist:5d01e4a32fc3d6022fd7
<!-- MockJax example with Bootstrap 3.2 -->
<script>
/**** MockJax to mock up an ajax response **/
$.mockjax({
url: '/like',
responseTime: 1000,
responseText: {
status: 'success',
@imasif
imasif / oh-my-zsh.sh
Last active Aug 29, 2015
How to install oh-my-zsh on Elementary OS #oh-my-zsh
View oh-my-zsh.sh
# 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