Skip to content

Instantly share code, notes, and snippets.

@lakhansamani
lakhansamani / my_first.md
Last active August 29, 2015 13:57
my first markdown

Hello World

Hello World

Hello World

Hello World

Hello World
@lakhansamani
lakhansamani / underscorejs.md
Created October 27, 2015 18:51
Why Underscore.JS

#Why to use Underscore.JS

How to index pdf file in elastic search

In this example we will be looking at elastic search instance which is dockerized

  • docker exec -it [elasticsearch-container-name] bin/elasticsearch-plugin install ingest-attachment
  • Restart docker container

Steps for kubernets on ubuntu 14.04

  • git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.5.0
  • echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
  • echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
  • source ~/.zshrc
  • asdf plugin-add minikube
  • asdf install minikube 0.25.2
@lakhansamani
lakhansamani / syncLoopWithAsyncFunc.js
Created October 26, 2018 07:01
Make sure next async function is called after iteration is completed
const testArr = [[1,2], [3,4,]]
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const parseAsyncList = async (list) => {
await timeout(3000)
return list
}
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.21176470588235294</real>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
@lakhansamani
lakhansamani / daemon-process-helper.md
Last active January 16, 2019 16:12
Command for running process in background

Run Process in background

nohup COMMAND &> LOG_FILENAME&

Find process

ps -A | grep PROCESS_NAME

Kill process