View Install previous versions with brew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew tap-new $USER/<package-name> | |
brew extract --version=<version-no> $USER/<package-name> | |
brew search /<package-name>/ | |
brew install <path to local formula> |
View Delete all containers and images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete all containers | |
docker rm -vf $(docker ps -aq) | |
# Delete all images | |
docker rmi -f $(docker images -aq) |
View PR Etiquette
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The purpose of this document is to record an etiquette guide for all pull requests in the any repository. Like all etiquette, it is designed to make life easier for everyone, and if a guideline ever becomes restrictive, we should reevaluate it. | |
This can generally be applied to other repos managed by Team 105. | |
# Contents | |
1. [Size](#size) | |
2. [Sequential PRs](#sequential-prs) | |
3. [Labels](#labels) | |
4. [Branch Names](#branch-names) |
View Alias command for bash profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add them to ~/.bash_profile | |
# reload bash profile in terminal using $. ~/.bash_profile | |
# git alias | |
alias gs="git status" | |
alias gpush="git push" | |
alias gpull="git pull" | |
alias gs="git status" | |
alias ga="git add" | |
alias gstash="git stash" |
View Delete all files in a floder with a particular match of regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It will delete all the files with there names matching the regex at once. | |
ls | grep <regex> | xargs rm | |
# eg. | |
# If we have files in our folder as "file.txt", "example.php", "new.html", "file_one.rb" | |
# For deleting files with "file" in their names just execute | |
# ls | grep file | xargs rm |
View login into postgres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for linux and AWS systems enter below two commands one by one | |
sudo -i -u postgres | |
psql | |
# for mac | |
psql postgres |
View database.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PostgreSQL. Versions 9.3 and up are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On macOS with Homebrew: | |
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config | |
# On macOS with MacPorts: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg |
View .bash_profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in you home direactory in the bash profile to display branch name in terminal add parsing script | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
View install_docker_on_ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uninstall Docker | |
sudo apt-get remove docker docker-engine docker-ce docker.io | |
# Update the apt package index | |
sudo apt-get update | |
# Allow apt to use a repository over HTTPS | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ |
View prime.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1 is treated as prime as per this function. | |
create function is_prime(num integer) returns boolean as $$ | |
begin -- begin block; | |
for i in 2..(num/2) loop | |
if num % i = 0 then | |
return false; -- return false if it's get divided by any number smaller than half of it or half itself. | |
end if; | |
end loop; | |
return true; |
NewerOlder