Skip to content

Instantly share code, notes, and snippets.

View overdrivemachines's full-sized avatar

Dipen Chauhan overdrivemachines

View GitHub Profile
@overdrivemachines
overdrivemachines / routes.rake
Created October 14, 2025 06:14
routes.rake
task routes: :environment do
Rails.application.eager_load!
models = ApplicationRecord.descendants.collect(&:name).join("|").downcase
controllers = ApplicationController.descendants.collect(&:name)
controllers = (controllers.map { |controller| controller[0..-11].downcase }).join("|")
if models
puts `bundle exec rails routes -g "#{models}|#{controllers}"`
else
puts `bundle exec rails routes -g "#{controllers}"`
end
@overdrivemachines
overdrivemachines / edit_credentials.sh
Created October 14, 2025 06:13
edit_credentials.sh
#!/usr/bin/env bash
# edit_credentials.sh
# Usage:
# ./edit_credentials.sh -> opens default (no --environment)
# ./edit_credentials.sh -p -> opens production credentials
# ./edit_credentials.sh --prod
# ./edit_credentials.sh --production
set -euo pipefail
@overdrivemachines
overdrivemachines / template.rb
Last active October 14, 2025 06:21
template.rb - Ruby on Rails Template
require 'net/http'
require 'uri'
# === Remove Comments in Gemfile ===
# Path to the Gemfile
gemfile_path = 'Gemfile'
# Read the content of the Gemfile
gemfile_content = File.read(gemfile_path)
# Remove comments from the Gemfile
gemfile_content.gsub!(/^#.*$/, '')
@overdrivemachines
overdrivemachines / gemfile.md
Created November 21, 2023 00:42
Gems Added to Gemfile and Configuration
  • Add gems to Gemfile:
gem "sassc-rails"
gem "image_processing", "~> 1.2"
gem "devise"


# In development group:
gem "rails-erd"
@overdrivemachines
overdrivemachines / vscode_global_gems.sh
Created November 21, 2023 00:18
Gems used by VSCode
gem install solargraph
gem install rubocop
gem install rubocop-performance
gem install rubocop-rails
gem install rubocop-rspec
gem install rubocop-md
gem install erb-formatter
gem install htmlbeautifier
@overdrivemachines
overdrivemachines / settings.json
Last active November 21, 2023 01:04
VSCode Settings (located in ~/Library/Application Support/Code/User/settings.json)
{
"[erb]": {
"editor.defaultFormatter": "aliariff.vscode-erb-beautify",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[ruby]": {
"editor.defaultFormatter": "misogi.ruby-rubocop"
@overdrivemachines
overdrivemachines / .rubocop.yml
Last active January 28, 2024 08:39
Rubocop
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
- rubocop-md
AllCops:
NewCops: enable
Exclude:
- "vendor/**/*"
@overdrivemachines
overdrivemachines / python.md
Last active August 14, 2023 04:10
Python Guide

Python Guide

Naming Conventions

  • Variables, Functions: snake_case
  • Class Names: CamelCase, MyClass, PersonDetails

Data Structures

Lists

my_list = [1, 2, 3, 4, 5]
@overdrivemachines
overdrivemachines / windows11.md
Last active August 2, 2023 01:49
Things to do after installing Windows 11

GPG Keys

  • Find link to GPG key online and save it in usr/share/keyrings/ with the command:
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnpkg.gpg > /dev/null
  • Create yarnpkg.list in etc/apt/sources.list.d/ with the contents:
deb [signed-by=/usr/share/keyrings/yarnpkg.gpg] https://dl.yarnpkg.com/debian/ stable main