Skip to content

Instantly share code, notes, and snippets.

@nitanshu
nitanshu / prepend_text_in_special_extension_file.sh
Last active August 7, 2019 08:55
It will prepend lines of text in all the files with specific extension
for file in $(find . -name "*.ts"); do
echo Processing $file
cat license.txt $file > $file.modified
mv $file.modified $file
done
@nitanshu
nitanshu / skip_all_fiter.rb
Last active September 19, 2017 08:59
To skip all filters for the particular action
skip_filter *_process_action_callbacks.map(&:filter), :only => [:action_goes_here]
@nitanshu
nitanshu / pre-push.sh
Created July 18, 2017 09:22
This is local pre-push the developer will not be allowed to push to that branch
# !/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
# 3. Or, use `rake hooks:pre_push` to install
@nitanshu
nitanshu / workspaces.sh
Last active July 18, 2017 07:42
It will switch your workspace after 5 seconds
# If your system does not have xdotool please install it
# sudo apt-get install xdotool
# copy this file to /bin folder
# cd /bin
# sh workspaces.sh
while true
do xdotool key ctrl+alt+Right
sleep 5
xdotool key ctrl+alt+Down
sleep 5