Skip to content

Instantly share code, notes, and snippets.

View hexmo's full-sized avatar

Mohit Acharya hexmo

View GitHub Profile
#!/bin/bash
directory="company-reposts-2024"
files_directory="/<location>/$directory"
final_directory="/<location>/$directory"
# Create the destination directory if it doesn't exist
mkdir -p "$files_directory"
# Move to the directory containing the .xls files
@hexmo
hexmo / .htaccess
Created August 1, 2023 03:43
Angular app deployment with CPanel
RewriteEngine On
# Force HTTPS redirection
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  # If an existing asset or directory is requested go to it as it is
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
  RewriteRule ^ - [L]
@hexmo
hexmo / .bashrc
Created November 29, 2022 09:43
Bash aliases for Dockerized Ruby On Rails app
# docker compose
alias dcbuild='docker-compose build'
alias dcup='docker-compose up' #start all containers
alias dcdown='docker-compose down' #stop all contailers
alias dcrails='docker-compose run app rails' #run rails commands e.g. "dcrails db:migrate"
alias dctest='docker-compose run app rails test' #run tests
alias dcre='docker-compose down && docker-compose up' #stop and then re-start all containers
# debugs
alias dcdebug='docker-compose up -d && docker attach $(docker-compose ps -q app)'
@hexmo
hexmo / rails http status codes
Created January 7, 2022 16:18 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing