Skip to content

Instantly share code, notes, and snippets.

View eclectic-coding's full-sized avatar
🏠
Working from home

Chuck eclectic-coding

🏠
Working from home
View GitHub Profile
@yahonda
yahonda / ruby31onrails.md
Last active June 25, 2024 20:26
Ruby 3.1 on Rails

Ruby 3.1 on Rails

Actions required to use Ruby 3.1.0 with Rails

Rails 7.0.Z

  • Rails 7.0.1 is compatible with Ruby 3.1.0.
  • Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
  • thor 1.2.1 has been released. You will not see DidYouMean::SPELL_CHECKERS.merge deprecate warnings anymore.

Rails 6.1.Z

  • Use Rails 6.1.5 to support database.yml with aliases and secrets.yml with aliases.
@peterhellberg
peterhellberg / alacritty.yml
Last active April 23, 2023 09:58
Alacritty configuration with Jellybeans colorscheme, and ⌘↵ to ToggleSimpleFullscreen
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
@hopsoft
hopsoft / Dockerfile
Last active May 17, 2023 19:58
Dockerize your Rails app
FROM ruby:3.0-alpine
RUN apk add --no-cache --update \
ack \
bash \
build-base \
curl \
git \
htop \
less \
@KonnorRogers
KonnorRogers / postcss.config.js
Created March 10, 2021 02:50
purgecss for rails
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [
'./app/**/*.html.erb',
'./app/helpers/**/*.rb',
'./app/javascript/**/*.js',
],
defaultExtractor: content => {
const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || []
const innerMatches = content.match(/[^<>"'`\s.()]*[^<>"'`\s.():]/g) || []
return broadMatches.concat(innerMatches)
@sowenjub
sowenjub / fun_with_splats.rb
Last active February 24, 2021 19:12
Some notes about the splat operator
def args_to_array(*args)
p args
end
args_to_array("hello", "world")
# ["hello", "world"]
def args_to_array(foo, *args) # Works, order matters
p "foo: #{foo}", args
end
args_to_array("hello", "world")
@swanson
swanson / .irbrc
Last active March 3, 2024 17:14
.irbrc color coding Rails console by environment
# Add color coding based on Rails environment for safety
if defined? Rails
banner = if Rails.env.production?
"\e[41;97;1m #{Rails.env} \e[0m "
else
"\e[42;97;1m #{Rails.env} \e[0m "
end
# Build a custom prompt
<!DOCTYPE html>
<html>
<head>
<title>React Todos in Vanilla JS</title>
<style type="text/css">
body {
margin: 0 auto;
max-width: 40em;
width: 88%;
}
<!DOCTYPE html>
<html>
<head>
<title>React Todos in Vanilla JS</title>
<style type="text/css">
body {
margin: 0 auto;
max-width: 40em;
width: 88%;
}
@danielwestendorf
danielwestendorf / pre-commit
Last active May 6, 2021 15:38
Enforce codestyle automatically on git commit
#!/bin/sh
# Create this file here: ./.git/hooks/pre-commit
# chmod +x ./.git/hooks/pre-commit
.git/hooks/pre-commit-format-js
.git/hooks/pre-commit-format-ruby
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active July 22, 2024 21:07
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent