Skip to content

Instantly share code, notes, and snippets.

Avatar

Manvendra Singh ManvendraSK

View GitHub Profile
@ManvendraSK
ManvendraSK / .vimrc
Last active Nov 18, 2019
Sample .vimrc to enable React and JSX inside vim with emmet and other things.
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@ManvendraSK
ManvendraSK / external_configuration_in_grails_3.md
Last active Sep 23, 2019
Enable external configuration in Grails 3
View external_configuration_in_grails_3.md

External configuration in Grails 3


Working on Grails 3 I realized that I no longer can specify external configuration using the standard grails.config.locations property in Config.groovy file.

Reason is obvious! There is no Config.groovy now in Grails 3. Instead we now use application.yml to configure the properties. However, you can't specify the external configuration using this file too!

What the hack?

Now Grails 3 uses Spring's property source concept. To enable external config file to work we need to do something extra now.

View terminal-cheat-sheet.txt
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
View Queues-using-stacks.md
class Stack {
  constructor() {
    this.arr = [];
  }

  peek() {
    return this.arr[this.arr.length - 1]
  }
View .zshrc.md
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
  export ZSH=/home/manvendra/.oh-my-zsh

# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@ManvendraSK
ManvendraSK / ConEmu Git Bash.md
Last active Sep 17, 2017 — forked from n3dst4/ConEmu Git Bash.md
My ConEmu / Cmder git bash task config
View ConEmu Git Bash.md
  1. Open Conemu

  2. Open Settings -> Tasks or go to new tab button -> Setup tasks.

  3. Click + to add a new task

  4. Enter the name as Git Bash or whatever you like

  5. Task parameters:

      /icon "C:\Program Files\Git\mingw64\share\git\git-for-windows.ico"
    
  6. Command:

@ManvendraSK
ManvendraSK / VS Code settings.md
Created Aug 28, 2017
Settings I use on VS Code to assist in coding.
View VS Code settings.md

Keymap

// Place your key bindings in this file to overwrite the defaults
[
    {
        "key": "ctrl+b",
        "command": "editor.action.goToDeclaration",
        "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
    },
    {
@ManvendraSK
ManvendraSK / Sublime Text Packages I use.md
Created Jan 24, 2017
Lists all the packages that I have installed on my computer.
View Sublime Text Packages I use.md
{
	"bootstrapped": true,
	"in_process_packages":
	[
	],
	"installed_packages":
	[
		"Agila Theme",
		"AutoFileName",
@ManvendraSK
ManvendraSK / script.md
Created Oct 18, 2016
Do the harlem shake script for any website
View script.md

Copy paste following code in the browser console.

javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document
@ManvendraSK
ManvendraSK / sublime-keymap.md
Last active Oct 15, 2016
Sublime Text 3 | Preferences and Key bindings
View sublime-keymap.md
[
  { "keys": ["f2"], "command": "toggle_side_bar" },
  { "keys": ["f1"], "command": "focus_side_bar" },
  { "keys": ["f4"], "command": "reveal_in_side_bar"},
  { "keys": ["ctrl+b"], "command": "goto_definition" },
]