Skip to content

Instantly share code, notes, and snippets.

View pedromschmitt's full-sized avatar
🎲

Pedro Schmitt pedromschmitt

🎲
View GitHub Profile
@filipemenezes
filipemenezes / init.vim
Last active September 15, 2022 18:52
My neovim setup
:call plug#begin('~/.vim/plugged')
Plug 'morhetz/gruvbox'
call plug#end()
" ------------------------------- General settings
set nocompatible
@kirillshevch
kirillshevch / rails_new_options_help.md
Last active April 24, 2025 22:49
"rails new" options for generating a new Rails application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 8+

Usage:
  rails COMMAND [options]

You must specify a command:
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active May 9, 2025 21:43
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@amitkhare
amitkhare / node_nginx_ssl.md
Created May 6, 2020 06:48 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@ThomasBush
ThomasBush / youtube-video-commands
Last active February 11, 2024 03:21
Ubuntu 20.04 Focal Fossa Rails server setup
# Generate Random Passwords
curl 'https://www.random.org/passwords/?num=2&len=24&format=plain&rnd=new'
# Create deploy user
sudo adduser deploy
sudo adduser deploy sudo
su deploy
cd ../deploy/
# Generate ssh keys 
@seanharmer
seanharmer / gist:f0fb73170853c5628613ef90ed3b540c
Created December 10, 2020 08:36
Rails font awesome xlink
# app/helpers/application_helper.rb
module ApplicationHelper
def declare_fa_icon(options, anchor_name)
fa_icon(options, data: { 'fa-symbol': anchor_name })
end
def use_fa_icon(anchor_name, text)
%Q(<svg class="icon-fa-xs"><use xlink:href="##{anchor_name}"></use></svg>#{text}).html_safe
end
@julianrubisch
julianrubisch / turbo_frame_history_controller.js
Last active May 8, 2021 02:39
Tabbed navigation with turbo
import { navigator } from "@hotwired/turbo";
import { Controller } from "stimulus";
import { useMutation } from "stimulus-use";
export default class extends Controller {
connect() {
useMutation(this, { attributes: true, childList: true, subtree: true });
}
mutate(entries) {
@afomera
afomera / README.md
Last active January 1, 2023 14:48
How to customize Bootstrap with esbuild-rails

How to customize Bootstrap 5 with esbuild-rails

You can see the various files added in this gist to really do the bulk of the work.

The important bits seem to be:

yarn add esbuild-sass-plugin
@mrjonesbot
mrjonesbot / navigation_controller.js
Created April 25, 2022 22:03
Light Stimulus controller that manages accordion side navigation behavior
import ApplicationController from './application_controller'
export default class extends ApplicationController {
static targets = ["selectable"]
static values = {
selectedClass: String
}
select(event) {
const previousElement = this.selectableTargets.find(target => target.classList.contains(this.selectedClassValue))