<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ritik Soni</title>
    <description>The latest articles on DEV Community by Ritik Soni (@ritiksoni00).</description>
    <link>https://dev.to/ritiksoni00</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F444433%2F3116313d-17f8-43c1-bc2a-e0f0353d3ed6.jpeg</url>
      <title>DEV Community: Ritik Soni</title>
      <link>https://dev.to/ritiksoni00</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ritiksoni00"/>
    <language>en</language>
    <item>
      <title>How to Handle Static Files in Production server of Django.</title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Wed, 17 Aug 2022 06:54:00 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/how-to-handle-static-files-in-production-server-of-django-5bgb</link>
      <guid>https://dev.to/ritiksoni00/how-to-handle-static-files-in-production-server-of-django-5bgb</guid>
      <description>&lt;p&gt;while working in the Development environment we use &lt;code&gt;python manage.py runserver&lt;/code&gt; so Django makes the development environment faster automatically by serving the static files for us. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py runserver&lt;/code&gt; command uses  &lt;code&gt;django.contrib.staticfiles&lt;/code&gt; module to server the static files in development when DEBUG is set to True. if we set DEBUG to False then it does not uses &lt;code&gt;django.contrib.staticfiles&lt;/code&gt;. and then we have to server our static files manually by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.conf&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.conf.urls.static&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;static&lt;/span&gt;

&lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="c1"&gt;# ... the rest of your URLconf goes here ...
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;static&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATIC_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;document_root&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATIC_ROOT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as described in the &lt;a href="https://docs.djangoproject.com/en/4.1/howto/static-files/#:~:text=For%20example%2C%20if%20your%20STATIC_URL%20is%20defined%20as%20static/%2C%20you%20can%20do%20this%20by%20adding%20the%20following%20snippet%20to%20your%20urls.py%3A"&gt;Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Production Django just dont want to serve static files for us its just neglect all of them.. so for that we have light weight library, which can easily solve this problem, Called &lt;a href="http://whitenoise.evans.io/en/stable/index.html"&gt;whitenoise&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;solve your problem in three steps:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;install whitenoise &lt;code&gt;pip install whitenoise&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;"whitenoise.middleware.WhiteNoiseMiddleware",&lt;/code&gt; add this middleware to your &lt;code&gt;MIDDLEWARE&lt;/code&gt; list in &lt;code&gt;settings.py&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;"whitenoise.runserver_nostatic",&lt;/code&gt; add this line to your I&lt;code&gt;NSTALLED_APPS&lt;/code&gt; list.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is how i handled my static files in production as like so many other guys. Hope you can too!&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>staticwebapps</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Learn About Django `StaticFiles`.</title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Sat, 13 Aug 2022 08:58:00 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/learn-about-django-staticfiles-16pb</link>
      <guid>https://dev.to/ritiksoni00/learn-about-django-staticfiles-16pb</guid>
      <description>&lt;p&gt;definition of &lt;strong&gt;static_url&lt;/strong&gt;, &lt;strong&gt;static_root&lt;/strong&gt;, &lt;strong&gt;STATICFILES_DIRS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;static_url&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it does nothing other then prepending onto your static file url&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;static_root&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it is the root folder path where our static file will be saved after running &lt;code&gt;collectstatic&lt;/code&gt; management command. it has nothing to do in our development server because &lt;code&gt;runserver&lt;/code&gt; helps us to serve our static files easily. but in Production server you wont be running &lt;code&gt;runserver&lt;/code&gt;. so thats where  &lt;strong&gt;static_root&lt;/strong&gt; comes into picture. if you are using any reverse proxy like nginx or apache then these proxy server needs some static root paths to serve static files. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;STATICFILES_DIRS&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It can be a tupel or a list of &lt;strong&gt;extra-static-paths&lt;/strong&gt; where you have placed some static-files for your project/app.

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;extra-static-paths&lt;/strong&gt; : your static file folder other then 
folder named &lt;code&gt;static&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Gitlab Upstream url[FIXED]</title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Sun, 31 Oct 2021 08:04:33 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/gitlab-upstream-urlfixed-2hkg</link>
      <guid>https://dev.to/ritiksoni00/gitlab-upstream-urlfixed-2hkg</guid>
      <description>&lt;p&gt;short post about upstream url of gitlab:-&lt;/p&gt;

&lt;p&gt;The right way to set a upstream url of gitlab is:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add &amp;lt;upstream_name&amp;gt; &amp;lt;https://{your_username}@gitlab.com/&amp;lt;upstream_username&amp;gt;/&amp;lt;upstream_repo&amp;gt;.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you already had set your url just do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-url &amp;lt;upstream_name&amp;gt; &amp;lt;https://{your_username}@gitlab.com/&amp;lt;upstream_username&amp;gt;/&amp;lt;upstream_repo&amp;gt;.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope this one works for you!&lt;/p&gt;

</description>
      <category>git</category>
      <category>gitlab</category>
    </item>
    <item>
      <title>mistakenly run git reset --hard HEAD~1.  [SOLVED]</title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Sat, 01 May 2021 00:06:06 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/mistakenly-run-git-reset-hard-head-1-solved-21i</link>
      <guid>https://dev.to/ritiksoni00/mistakenly-run-git-reset-hard-head-1-solved-21i</guid>
      <description>&lt;p&gt;for your kind info, this command takes you back to the last commit that has been pushed to Github!&lt;/p&gt;

&lt;p&gt;if you mistakenly run this command &lt;code&gt;git reset --hard HEAD~1&lt;/code&gt; so just do &lt;/p&gt;

&lt;p&gt;1 . &lt;code&gt;git reflog&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;you will have your git commit history, like this:- &lt;/p&gt;

&lt;p&gt;&lt;code&gt;caee549 (HEAD -&amp;gt; master, origin/master) HEAD@{2}: reset: moving to HEAD~1&lt;br&gt;
237ec6c HEAD@{3}: commit: &amp;lt;&amp;lt;your last git-committed message here&amp;gt;&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;in my case, I want to go back on &lt;code&gt;237ec6c&lt;/code&gt; this commit:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;git reset --hard 237ec6c&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and voila!&lt;br&gt;
hope this helps! &lt;br&gt;
if not check out this one:- &lt;a href="https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1"&gt;stackoverflow&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>gitreset</category>
      <category>github</category>
    </item>
    <item>
      <title>Set Up Vim For Cpp</title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Thu, 07 Jan 2021 15:22:35 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/set-up-vim-for-cpp-pj</link>
      <guid>https://dev.to/ritiksoni00/set-up-vim-for-cpp-pj</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb5rh6so4aqpjum22wk3w.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb5rh6so4aqpjum22wk3w.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So Today, Somehow I able to set up my vim(vi Improved) for my Competitive Programming Journey! it actually took my whole day so I don't want that you also f'''k up your mind . just chill here we go.:-&lt;/p&gt;

&lt;p&gt;p.s:-I'll be using Linux as my OS! &lt;/p&gt;

&lt;p&gt;installing:- &lt;code&gt;Sudo apt-get install vim&lt;/code&gt; &lt;br&gt;
          :- &lt;code&gt;Sudo apt-get install g++&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;update:- &lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;now there is a ".vimrc" file in your home directory. &lt;br&gt;
if there is no such file simply make a new one named ".vimrc" in the home directory.&lt;/p&gt;

&lt;p&gt;edit it with this code given below:-&lt;/p&gt;

&lt;p&gt;AND DONT TRY TO FULLY UNDERSTAND IT IF YOU ARE USING VIM FIRST TIME&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;" .vimrc of Bo Liu
" {{{
" https://github.com/hmybmny/vimrc

set nocompatible

" }}}

" VIM-PLUG BLOCK
" {{{

silent! if plug#begin('~/.vim/plugged')

" Colors
Plug 'altercation/vim-colors-solarized'
Plug 'tomasr/molokai'
Plug 'colepeters/spacemacs-theme.vim'
Plug 'sheerun/vim-polyglot'

" Editing
Plug 'SirVer/ultisnips'
Plug 'sjl/gundo.vim'
Plug 'matze/vim-move'
Plug 'jiangmiao/auto-pairs'
Plug 'kana/vim-operator-user'
Plug 'gcmt/wildfire.vim'
Plug 'lilydjwg/fcitx.vim'
Plug 'scrooloose/nerdcommenter'
Plug 'derekwyatt/vim-protodef', { 'for': ['c', 'cpp', 'objc'] }
Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }

" Navigation
Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
Plug 'derekwyatt/vim-fswitch', { 'for': ['c', 'cpp', 'objc'] }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'dyng/ctrlsf.vim'
Plug 'fholgado/minibufexpl.vim'

" View
Plug 'Yggdroot/indentLine'
Plug 'airblade/vim-gitgutter'

" Linting
Plug 'w0rp/ale'

"cd ~
"mkdir ycm_build
"cd ycm_build/
"cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/Downloads/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04 . ~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp
"cmake --build . --target ycm_core

"Plug 'Valloric/YouCompleteMe'

function! BuildYCM(info)
if a:info.status == 'installed' || a:info.force
  !./install.py --clang-completer
endif
endfunction

Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }

call plug#end()
endif

" }}}

" BASIC SETTINGS
" {{{

let mapleader = ';'

set encoding=utf-8

" Allow backspacing over everything in insert mode
set backspace=indent,eol,start

" Store lots of :cmdline history
set history=500

" Show line numbers
set nu

set nowrap

" Autoindent when starting new line
set autoindent
set smartindent
set lazyredraw

" Ignore case when searching
set ignorecase 

" Don't ignore case when search has capital letter
set smartcase

" Enable highlighted case-insensitive incremential search
set incsearch

" Enble search highlighting
set hlsearch

" Always show window statuses
set laststatus=2

" Statusline style
set statusline=
set statusline+=%7*\[%n]                                  "buffernr
set statusline+=%1*\ %&amp;lt;%F\                                "File+path
set statusline+=%2*\ %y\                                  "FileType
set statusline+=%3*\ %{''.(&amp;amp;fenc!=''?&amp;amp;fenc:&amp;amp;enc).''}      "Encoding
set statusline+=%3*\ %{(&amp;amp;bomb?\",BOM\":\"\")}\            "Encoding2
set statusline+=%4*\ %{&amp;amp;ff}\                              "FileFormat (dos/unix..) 
set statusline+=%8*\ %=\ row:%l/%L\ (%p%%)\             "Rownumber/total (%)
set statusline+=%9*\ col:%c\                            "Colnr
set statusline+=%0*\ \ %m%r%w\ %P\ \                      "Modified? Readonly? Top/bot.

" Show the size of block one selected in visual mode
set showcmd

" Hide buffers
set hidden
set visualbell

" Indent using four spaces
set expandtab smarttab
set tabstop=2
set shiftwidth=2
set softtabstop=2

set gcr=a:block-blinkon0

set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
set guioptions-=m
set guioptions-=T

function! ToggleFullscreen()
call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")
endf

map &amp;lt;silent&amp;gt; &amp;lt;F11&amp;gt; :call ToggleFullscreen()&amp;lt;CR&amp;gt;
imap &amp;lt;silent&amp;gt; &amp;lt;F11&amp;gt; &amp;lt;esc&amp;gt;:call ToggleFullscreen()&amp;lt;CR&amp;gt;
" autocmd VimEnter * call ToggleFullscreen()

" Show the line and column number of the cursor position
set ruler

" Highlight line under cursor
set cursorline
set cursorcolumn


" }}}

" MAPPINGS
" {{{

" ----------------------------------------------------------------------------
" Basic mappings
" ----------------------------------------------------------------------------

" Profile
iabbrev @@ hmybmny@gmail.com
iabbrev @b hmybmny.com

" Edit myvimrc
nnoremap &amp;lt;leader&amp;gt;ev :vsplit $MYVIMRC&amp;lt;cr&amp;gt;
nnoremap &amp;lt;leader&amp;gt;sv :source $MYVIMRC&amp;lt;cr&amp;gt;

" Edit
nnoremap &amp;lt;leader&amp;gt;" viw&amp;lt;esc&amp;gt;a"&amp;lt;esc&amp;gt;hbi"&amp;lt;esc&amp;gt;lel

" Save
inoremap &amp;lt;C-s&amp;gt;     &amp;lt;C-O&amp;gt;:w&amp;lt;cr&amp;gt;
nnoremap &amp;lt;C-s&amp;gt;     :w&amp;lt;cr&amp;gt;
nnoremap &amp;lt;leader&amp;gt;w :w&amp;lt;cr&amp;gt;

" Copy
vnoremap &amp;lt;Leader&amp;gt;y "+y
nmap &amp;lt;Leader&amp;gt;p "+p

" Quit
nnoremap &amp;lt;Leader&amp;gt;q :q&amp;lt;cr&amp;gt;
nnoremap &amp;lt;Leader&amp;gt;Q :qa!&amp;lt;cr&amp;gt;

" Movement in insert mode
inoremap &amp;lt;C-h&amp;gt; &amp;lt;C-o&amp;gt;h
inoremap &amp;lt;C-j&amp;gt; &amp;lt;C-o&amp;gt;j
inoremap &amp;lt;C-k&amp;gt; &amp;lt;C-o&amp;gt;k
inoremap &amp;lt;C-l&amp;gt; &amp;lt;C-o&amp;gt;a
inoremap &amp;lt;C-^&amp;gt; &amp;lt;C-o&amp;gt;&amp;lt;C-^&amp;gt;

" ----------------------------------------------------------------------------
" Quickfix
" ----------------------------------------------------------------------------

nnoremap ]q :cnext&amp;lt;cr&amp;gt;zz
nnoremap [q :cprev&amp;lt;cr&amp;gt;zz

" ----------------------------------------------------------------------------
" &amp;lt;tab&amp;gt; / &amp;lt;s-tab&amp;gt; | Circular windows navigation
" ----------------------------------------------------------------------------

nnoremap &amp;lt;tab&amp;gt;   &amp;lt;c-w&amp;gt;w
nnoremap &amp;lt;S-tab&amp;gt; &amp;lt;c-w&amp;gt;W
nnoremap &amp;lt;Leader&amp;gt;hw &amp;lt;C-W&amp;gt;h
nnoremap &amp;lt;Leader&amp;gt;jw &amp;lt;C-W&amp;gt;j
nnoremap &amp;lt;Leader&amp;gt;kw &amp;lt;C-W&amp;gt;k
nnoremap &amp;lt;Leader&amp;gt;lw &amp;lt;C-W&amp;gt;l

" ----------------------------------------------------------------------------
" :CopyRTF
" ----------------------------------------------------------------------------

function! s:colors(...)
return filter(map(filter(split(globpath(&amp;amp;rtp, 'colors/*.vim'), "\n"),
    \                  'v:val !~ "^/usr/"'),
    \           'fnamemodify(v:val, ":t:r")'),
    \       '!a:0 || stridx(v:val, a:1) &amp;gt;= 0')
endfunction

" ----------------------------------------------------------------------------
" &amp;lt;F8&amp;gt; | Color scheme selector
" ----------------------------------------------------------------------------
"  
set background=dark

let g:molokai_original = 1
colorschem molokai

function! s:rotate_colors()
  if !exists('s:colors')
    let s:colors = s:colors()
  endif
  let name = remove(s:colors, 0)
  call add(s:colors, name)
  set background=dark
  execute 'colorscheme' name
  redraw
  echo name
endfunction

nnoremap &amp;lt;silent&amp;gt; &amp;lt;F8&amp;gt; :call &amp;lt;SID&amp;gt;rotate_colors()&amp;lt;cr&amp;gt;
inoremap &amp;lt;silent&amp;gt; &amp;lt;F8&amp;gt; &amp;lt;esc&amp;gt;:call &amp;lt;SID&amp;gt;rotate_colors()&amp;lt;cr&amp;gt;

" }}}

" PLUGINS
" {{{

" ----------------------------------------------------------------------------
" ultisnips
" ----------------------------------------------------------------------------

let g:UltiSnipsSnippetDirectories=["mysnippets"]
let g:UltiSnipsExpandTrigger="&amp;lt;leader&amp;gt;&amp;lt;tab&amp;gt;"
let g:UltiSnipsJumpForwardTrigger="&amp;lt;leader&amp;gt;&amp;lt;tab&amp;gt;"
let g:UltiSnipsJumpBackwardTrigger="&amp;lt;leader&amp;gt;&amp;lt;s-tab&amp;gt;"

" ----------------------------------------------------------------------------
" vim-multiple-cursors
" ----------------------------------------------------------------------------

let g:multi_cursor_next_key='&amp;lt;S-n&amp;gt;'
let g:multi_cursor_skip_key='&amp;lt;S-k&amp;gt;'

" ----------------------------------------------------------------------------
" vim-move
" ----------------------------------------------------------------------------

let g:move_key_modifier = 'C'

" ----------------------------------------------------------------------------
" auto-pairs
" ----------------------------------------------------------------------------

" ----------------------------------------------------------------------------
" vim-operator-user
" ----------------------------------------------------------------------------

" ----------------------------------------------------------------------------
" wildfire.vim
" ----------------------------------------------------------------------------

map &amp;lt;SPACE&amp;gt; &amp;lt;Plug&amp;gt;(wildfire-fuel)
vmap &amp;lt;C-SPACE&amp;gt; &amp;lt;Plug&amp;gt;(wildfire-water)

" ----------------------------------------------------------------------------
" indentLine
" ----------------------------------------------------------------------------

let g:indentLine_char = '│'

" ----------------------------------------------------------------------------
" tarbar
" ----------------------------------------------------------------------------

inoremap &amp;lt;F2&amp;gt; &amp;lt;esc&amp;gt;:TagbarToggle&amp;lt;cr&amp;gt;
nnoremap &amp;lt;F2&amp;gt; :TagbarToggle&amp;lt;cr&amp;gt;

let tagbar_left=1
let tagbar_width=32
let g:tagbar_sort = 0
let g:tagbar_compact=1
let g:tagbar_type_cpp = {
 \ 'ctagstype' : 'c++',
 \ 'kinds'     : [
     \ 'c:classes:0:1',
     \ 'd:macros:0:1',
     \ 'e:enumerators:0:0', 
     \ 'f:functions:0:1',
     \ 'g:enumeration:0:1',
     \ 'l:local:0:1',
     \ 'm:members:0:1',
     \ 'n:namespaces:0:1',
     \ 'p:functions_prototypes:0:1',
     \ 's:structs:0:1',
     \ 't:typedefs:0:1',
     \ 'u:unions:0:1',
     \ 'v:global:0:1',
     \ 'x:external:0:1'
 \ ],
 \ 'sro'        : '::',
 \ 'kind2scope' : {
     \ 'g' : 'enum',
     \ 'n' : 'namespace',
     \ 'c' : 'class',
     \ 's' : 'struct',
     \ 'u' : 'union'
 \ },
 \ 'scope2kind' : {
     \ 'enum'      : 'g',
     \ 'namespace' : 'n',
     \ 'class'     : 'c',
     \ 'struct'    : 's',
     \ 'union'     : 'u'
 \ }
\ }

" ----------------------------------------------------------------------------
" vim-fswitch
" ----------------------------------------------------------------------------

nmap &amp;lt;silent&amp;gt; &amp;lt;Leader&amp;gt;fs :FSHere&amp;lt;cr&amp;gt;

" ----------------------------------------------------------------------------
" vim-protodef
" ----------------------------------------------------------------------------

let g:protodefprotogetter='~/.vim/plugged/vim-protodef/pullproto.pl'
let g:disable_protodef_sorting=1

" ----------------------------------------------------------------------------
" nerdcommenter
" ----------------------------------------------------------------------------

" ----------------------------------------------------------------------------
" nerdtree
" ----------------------------------------------------------------------------

inoremap &amp;lt;F3&amp;gt; &amp;lt;esc&amp;gt;:NERDTreeToggle&amp;lt;CR&amp;gt;
nnoremap &amp;lt;F3&amp;gt; :NERDTreeToggle&amp;lt;CR&amp;gt;

let NERDTreeWinSize=22
let NERDTreeWinPos="right"
let NERDTreeShowHidden=0
let NERDTreeMinimalUI=1
let NERDTreeAutoDeleteBuffer=1

" ----------------------------------------------------------------------------
" vim-instant-markdown
" ----------------------------------------------------------------------------

autocmd BufNewFile,BufReadPost *.md set filetype=markdown

let g:instant_markdown_slow = 1
let g:instant_markdown_autostart = 0

nnoremap &amp;lt;Leader&amp;gt;md :InstantMarkdownPreview&amp;lt;CR&amp;gt;


" ----------------------------------------------------------------------------
" vim-fugitive
" ----------------------------------------------------------------------------


" ----------------------------------------------------------------------------
" vim-gitgutter
" ----------------------------------------------------------------------------

set updatetime=250

set signcolumn=yes

" ----------------------------------------------------------------------------
" ale
" ----------------------------------------------------------------------------


" ----------------------------------------------------------------------------
" minibufexpl
" ----------------------------------------------------------------------------

inoremap &amp;lt;F4&amp;gt; &amp;lt;esc&amp;gt;:MBEToggle&amp;lt;cr&amp;gt;
nnoremap &amp;lt;F4&amp;gt; :MBEToggle&amp;lt;cr&amp;gt;

nnoremap ]b :bnext&amp;lt;cr&amp;gt;
nnoremap [b :bprev&amp;lt;cr&amp;gt;

" ----------------------------------------------------------------------------
" gundo.vim
" ----------------------------------------------------------------------------

nnoremap &amp;lt;Leader&amp;gt;ud :GundoToggle&amp;lt;CR&amp;gt;

set sessionoptions="blank,globals,localoptions,tabpages,sesdir,folds,help,options,resize,winpos,winsize"

if !strlen(finddir('~/.vim/undofiles'))
echo "undofiles[~/.vim/undofiles] not found. Now it's being created. Press ENTER or type command to continue."
!mkdir -p ~/.vim/undofiles
endif

if v:version &amp;gt;= 703
set undodir=~/.vim/undofiles
set undofile
set colorcolumn=+1 
endif

" ----------------------------------------------------------------------------
" ctrlsf.vim
" ----------------------------------------------------------------------------

nnoremap &amp;lt;c-f&amp;gt; :CtrlSF&amp;lt;CR&amp;gt;

" ----------------------------------------------------------------------------
" ctrlp.vim
" ----------------------------------------------------------------------------

" Disable output, vcs, archive, rails, temp and backup files
set wildignore+=*.o,*.out,*.obj,.git,*.pyc,*.class
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
set wildignore+=*.swp,*~,._*
set wildignore+=*/tmp/*,*.so,*.swp,*.zip     " MacOSX/Linux

let g:ctrlp_map = '&amp;lt;s-p&amp;gt;'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
  \ 'dir':  '\v[\/]\.(git|hg|svn|vendor/bundle/*\|vendor/cache/*\|public\|spec)$',
  \ 'file': '\v\.(exe|so|dll|swp|log|jpg|png|json)$',
  \ }

" ----------------------------------------------------------------------------
" YouCompleteMe
" ----------------------------------------------------------------------------

set completeopt-=preview

nnoremap &amp;lt;leader&amp;gt;jc :YcmCompleter GoToDeclaration&amp;lt;CR&amp;gt;
nnoremap &amp;lt;leader&amp;gt;jd :YcmCompleter GoToDefinition&amp;lt;CR&amp;gt;
inoremap &amp;lt;leader&amp;gt;; &amp;lt;C-x&amp;gt;&amp;lt;C-o&amp;gt;

"run and compile cpp
nnoremap &amp;lt;f8&amp;gt; :!g++ -o  %:r.out % -std=c++14&amp;lt;Enter&amp;gt;
autocmd filetype cpp nnoremap &amp;lt;f9&amp;gt; :!%:r.out&amp;lt;CR&amp;gt;


let g:ycm_complete_in_comments=1
let g:ycm_confirm_extra_conf=0
let g:ycm_collect_identifiers_from_tags_files=0
let g:ycm_min_num_of_chars_for_completion=1
let g:ycm_cache_omnifunc=0
let g:ycm_seed_identifiers_with_syntax=1

" }}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fkingofctrl%2Fvim.cpp%2Fblob%2Fmaster%2Fvimrc" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fkingofctrl%2Fvim.cpp%2Fblob%2Fmaster%2Fvimrc" alt="The above Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you are all set! hope it will help you a lot!&lt;/p&gt;

&lt;p&gt;mostly we will use 2 modes of VIM 1. Command &amp;amp; 2. INSERT&lt;/p&gt;

&lt;p&gt;Press &lt;code&gt;i&lt;/code&gt; to be in insert mode &amp;amp; &lt;code&gt;esc&lt;/code&gt; to exit! &lt;/p&gt;

&lt;p&gt;Easily write your Cpp code in INSERT mode and In command mode  &lt;code&gt;:F8&lt;/code&gt; type it and your file will be compiled again in command mode &lt;code&gt;:F9&lt;/code&gt; to run your file.&lt;/p&gt;

&lt;p&gt;ADios ME AMigos!&lt;/p&gt;

</description>
      <category>vim</category>
      <category>beginners</category>
      <category>setup</category>
      <category>cp</category>
    </item>
    <item>
      <title>apt update-fix not found packages! or guide to update successfully your Ubuntu  </title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Wed, 18 Nov 2020 14:06:48 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/apt-update-fix-not-found-packages-or-guide-to-update-successfully-your-ubuntu-mfk</link>
      <guid>https://dev.to/ritiksoni00/apt-update-fix-not-found-packages-or-guide-to-update-successfully-your-ubuntu-mfk</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JlXMN70r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w9ba3if8709tk0pda48j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JlXMN70r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w9ba3if8709tk0pda48j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
this picture is about &lt;b&gt;nodejs&lt;/b&gt; but ill tell you how you can handle this type of issue for any module or packages.&lt;/p&gt;

&lt;p&gt;when you mistakenly edit your source.list or you are having any error on updating your distro with &lt;code&gt;sudo apt-get update&lt;/code&gt; &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OBPgZF3Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9ok267yi31l7cr3zzt4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OBPgZF3Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9ok267yi31l7cr3zzt4o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  reason:-
&lt;/h4&gt;

&lt;p&gt;this is maybe your ubuntu mirror{your local region distribution for ubuntu} have some issues or you messed up with it. &lt;br&gt;
my region is India you can see in the image below it has &lt;code&gt;in.&lt;/code&gt; &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cwy3bWSf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4a9zj8egbav5fc0nvzuh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cwy3bWSf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4a9zj8egbav5fc0nvzuh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
you can check yours by &lt;code&gt;sudo nano /etc/apt/sources.list&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
when you open your sources.list  by the above command you just make a copy of this file for backup if something bad happens after pasting these URLs into sources.list&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiv&amp;gt;

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe mu&amp;gt;
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted univers&amp;gt;

deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe m&amp;gt;
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted univer&amp;gt;

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe &amp;gt;
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted unive&amp;gt;

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will help you!&lt;br&gt;
now save it and try to update by&lt;br&gt;
&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;br&gt;
and Voila!&lt;/p&gt;

&lt;p&gt;if you are still facing issues then let me know&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>discuss</category>
      <category>bash</category>
    </item>
    <item>
      <title>Twitter_bot Guidance for Beginners </title>
      <dc:creator>Ritik Soni</dc:creator>
      <pubDate>Tue, 17 Nov 2020 14:18:09 +0000</pubDate>
      <link>https://dev.to/ritiksoni00/twitterbot-guidance-for-beginners-jdl</link>
      <guid>https://dev.to/ritiksoni00/twitterbot-guidance-for-beginners-jdl</guid>
      <description>&lt;h1&gt;
  
  
  Twitter_BOT
&lt;/h1&gt;

&lt;p&gt;:-I'm hoping that you have some basic-sense nothing else!&lt;/p&gt;

&lt;h4&gt;
  
  
  Twitter BOT from Scratch to Deployment :)
&lt;/h4&gt;

&lt;p&gt;first, you will need a Twitter developer account! so go to &lt;a href="https://developer.twitter.com/en"&gt;Twitter Developr&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;after making a developer account (if you are facing issues than I cant do anything:() &lt;/p&gt;

&lt;p&gt;NOTE:-Consumer keys are the API KEYS too&lt;/p&gt;

&lt;p&gt;copy paste all the given keys into your notepad!&lt;/p&gt;

&lt;p&gt;--Coding Part--&lt;br&gt;
now you have to install "Tweepy" python lib that will help you to make contact with your Twitter developer account!&lt;/p&gt;

&lt;p&gt;1 .make a folder named BOT&lt;/p&gt;

&lt;p&gt;2.type following command in terminal&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install Tweepy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3.make a python file named= bot.py&lt;/p&gt;

&lt;p&gt;after this authentication comes into the role just copy-paste keys from your notepad into the python file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Tweepy

CONSUMER_KEY = "--"

CONSUMER_SECRET = "--"

ACCESS_KEY = "--"

ACCESS_SECRET = "--"

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

api = tweepy.API(auth)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after this you will write functions that will like and retweet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;QUERY='#programming' or '#technology' or '#coding' // you can edit this 
LIKE= True
FOLLOW= True

for tweet in tweepy.Cursor(api.search, q = QUERY).items(): 
        try: 
            print('\nTweet by: @' + tweet.user.screen_name) 
            tweet.retweet() 
            print('Retweeted the tweet') 

            if LIKE: 
                tweet.favorite() 
                print('Favorited the tweet') 

            if FOLLOW: 
                if not tweet.user.following: 
                    tweet.user.follow() 
                    print('Followed the user') 

            sleep(300)
        except tweepy.TweepError as e: 
                print(e.reason)

        except StopIteration: 
              break
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;your final python file will look like {if it is not same as yours so make it same}:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import tweepy
from time import sleep


CONSUMER_KEY = "--"
CONSUMER_SECRET = "--"
ACCESS_KEY = "--"
ACCESS_SECRET = "--"
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

api = tweepy.API(auth)

QUERY='#programming' or '#technology' or '#coding'
LIKE= True
FOLLOW= True

for tweet in tweepy.Cursor(api.search, q = QUERY).items(): 
        try: 
            print('\nTweet by: @' + tweet.user.screen_name) 
            tweet.retweet() 
            print('Retweeted the tweet') 

            if LIKE: 
                tweet.favorite() 
                print('Favorited the tweet') 

            if FOLLOW: 
                if not tweet.user.following: 
                    tweet.user.follow() 
                    print('Followed the user') 

            sleep(300)
        except tweepy.TweepError as e: 
                print(e.reason)

        except StopIteration: 
              break
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if you try to run this file in terminal via &lt;code&gt;python filename.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;you will see your output if not then its your mistake please copy paste carefully!&lt;/p&gt;

&lt;p&gt;in terminal :-&lt;code&gt;git add .&lt;/code&gt;&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           &lt;code&gt;git commit -m 'bot file created'&lt;/code&gt;&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Deployment&lt;br&gt;
&lt;/h1&gt;

&lt;p&gt;we will deploy our python file on Heroku!&lt;/p&gt;

&lt;p&gt;go to Heroku official website and make your FREE account after this in you folder make a file named "Procfile" (P capital)&lt;br&gt;
and type following&lt;/p&gt;

&lt;p&gt;&lt;code&gt;worker : python bot.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;save this!&lt;/p&gt;

&lt;p&gt;Go &lt;a href="https://blog.heroku.com/the_heroku_toolbelt"&gt;Here!&lt;/a&gt; and download it in your machine!&lt;/p&gt;

&lt;p&gt;in terminal type &lt;code&gt;heroku login&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;after successfully login in terminal&lt;/p&gt;

&lt;p&gt;type&lt;/p&gt;

&lt;p&gt;&lt;code&gt;heroku git:remote -a your_app_name_here&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push heroku master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and you have to on the app manually!&lt;br&gt;
and your twitter BOT is READY!&lt;/p&gt;

&lt;p&gt;Being Updated With time&lt;/p&gt;

</description>
      <category>twitterbot</category>
      <category>python</category>
      <category>twitter</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
