Skip to content

Instantly share code, notes, and snippets.

@prabeengiri
prabeengiri / vscode-config.config
Last active February 25, 2025 04:59
Development Environment Setup (VSCODE, ZSH)
# Plugins
1. Indenticator
2. ESLINT
3. Import Cost (Displays the imported lib file size)
4. vscode-icons
5. Quokka.js
6. Git Ignore
7. Git Lens
8. Markdown Preview Github Styling
9. Todo Tree
@prabeengiri
prabeengiri / fetch_pr.sh
Created May 11, 2017 18:20
Shell Script to Fetch PRs locally
set -e
read -e -p "Please enter PR Id (Assuming remote name is UPSTREAM): # " PR_ID
readonly branch_name=PR_BRANCH_$PR_ID
#Check if PR exists
if [ -ne `git ls-remote upstream 'pull/*/head' | grep pull/$PR_ID/head`]; then
echo "\033[33;31m Error: PR ($PR_ID) NOT FOUND"
exit;
@prabeengiri
prabeengiri / PopOver.js
Last active September 15, 2016 08:39
Custom ReactJs/Redux PopOver.
import React, {Component, PropTypes} from 'react';
import classNames from 'classnames';
import Trigger from './PopOverTrigger.js';
import Content from './PopOverContent.js';
class PopOver extends Component {
static propTypes = {
placement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
contentWidth: PropTypes.number,
@prabeengiri
prabeengiri / native_app_launcher.js
Last active February 1, 2016 07:36
AdvancedNativeAppLauncher
/**
*
* @return object
* Javascript object with 'init' method to initialize
* NativeAppLauncher
*/
var NativeAppLauncher = (function($) {
"use strict";
var Settings = {};
@prabeengiri
prabeengiri / native_app_launcher.js
Last active July 3, 2025 00:54
Native App Launcher (Works in ios9)
// NativeAppLauncher.
// Copied from bartt.me/openapp
var NativeAppLauncher = (function () {
var IOS_VERSION_RE = /OS\s+(\d)_/;
var timers = [];
var userAgent = window.navigator.userAgent;
var isAndroid = function () {
return /Android/.test(userAgent);
};
var isIOS = function () {
@prabeengiri
prabeengiri / sticky_sidebar.js
Created December 14, 2015 06:03
JQuery Sticky Sidebar
$.fn.stickySideBar = function () {
var $el = $(this);
var $sidebar_is_fixed = false;
var $sidebar_height = $el.height();
var $sidebar_width = $el.width();
if ($el.offset() == undefined) {
return;
}
var $sidebar_top = $el.offset().top;
var $scroll_fix_pos = ($sidebar_top + $sidebar_height) - $(window).height();
@prabeengiri
prabeengiri / solr_drupal_installation.txt
Created September 13, 2015 01:43
Installing Solr for Drupal.
1. Download Drupal apachesolr search module
2. Download solr 4.x and untar it outside the root folder
3. Change the defult port if required.
Goto solr/etc/jetty.xml
Find 8983 and replace with custom port.
4. Copy schema.xml and solrconfig.xml from apachesolr/solr-conf/solr-4.x to solr/example/solr/collection1/conf
5. Start Solr, cd solr/example, java -jar start.jar
@prabeengiri
prabeengiri / ssh_tunneling_multiple_server.scpt
Last active August 29, 2015 14:27
Applescript to launch ITerm and ssh tunelling and ssh into multiple servers with windows splitted horizontally
-- opens 4 tab with last 3 being a single tab splitted horizontally
tell application "iTerm"
activate
-- create new iterm window
set myterm to (make new terminal)
tell the myterm
activate current session
--new tab
launch session "[ITermProfileName]"
tell the last session
@prabeengiri
prabeengiri / .vimrc
Last active August 29, 2015 14:25
Vim Configuration for Drupal Development
// First Install Vim Drupal Module
drush @none dl vimrc
// Checkout vim installation options
drush help vimrc-install
// Install vim plugins
drush -v vimrc-install [options]
// For installing the color scheme
// Above command will install Vbundle so, clone the git colorscheme repo
// in the ~/.vim/bundle folder and add that colorscheme in the .vimrc file
# colorscheme vividchalk //https://github.com/modess/vim-phpcolors.git
@prabeengiri
prabeengiri / .gitconfig
Last active August 16, 2021 16:56
Git Config
# created .gitconfig file inside the $home(HOME) folder `/Users/[username]/` if not present
[user]
name = prabeen
email = [email protected]
[color]
ui = auto
[alias]
lg = log
lg2 = log --oneline --decorate