Skip to content

Instantly share code, notes, and snippets.

View DonSchado's full-sized avatar
🐢
null

Marco DonSchado

🐢
null
View GitHub Profile
@jeromedalbert
jeromedalbert / .gitattributes
Last active March 3, 2024 12:18
Automatically resolve Git merge conflicts in Rails schema.rb by picking the most recent date in the conflict (now works with Rails 5 and recent versions of Git). The following files should be in your home ~ directory. Inspired by https://tbaggery.com/2010/10/24/reduce-your-rails-schema-conflicts.html
db/schema.rb merge=railsschema
@andyyou
andyyou / rails_webpacker_bootstrap_expose_jquery.md
Last active August 9, 2022 07:38
Rails 5.2 with webpacker, bootstrap, stimulus starter

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
@mrmartineau
mrmartineau / stimulus.md
Last active July 18, 2024 07:43
Stimulus cheatsheet
@endverbraucher
endverbraucher / filter.js
Last active December 21, 2017 18:48
JavaScript Programming Exercise
// Railslove JavaScript programming exercise A1
//
// To run the following exercise you need to have mocha installed.
// Install mocha with yarn global add mocha or npm install -g mocha
//
// Then watch the output of `mocha filter.js` and see 4 of 5 failing tests.
//
// The task is to filter a given collection (L#35) for entries that contain unique pairs.
// While filtering return the same structure and keep the ranking.
// Write code in the body of the filter method to make the tests pass.
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@killthekitten
killthekitten / persistent_csrf_token_cookie.rb
Last active October 6, 2021 17:12
Persistent CSRF token cookie
@bmhatfield
bmhatfield / .profile
Last active June 18, 2024 09:38
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@scootcho
scootcho / rails commands.md
Last active September 30, 2022 09:23
rails console commands #rails #console #commands

open gem using bundler (in app root directory)

bundle open gem_name
bundle open activesupport

clear the console

control + l
command + k (mac)
@danielfone
danielfone / unindent.rb
Last active August 29, 2015 14:06 — forked from avdi/unindent.rb
TEXT = <<EOF
See, the interesting thing about this text
is that while it seems like the first line defines an indent
it's actually the last line which has the smallest indent
there are also some blank lines
both with and without extra spaces in them
and it just goes on and on