Skip to content

Instantly share code, notes, and snippets.

@evadne
evadne / 0_CONTRIBUTORS.md
Last active July 14, 2023 12:52
RVM + MRI + Capistrano + Puma + Sidekiq
  • Josh Goebel (@yyyc514): suggested lazy evaluation on set
@brianpattison
brianpattison / Gemfile
Last active March 12, 2021 00:29
Rails Livereload
source "https://rubygems.org"
ruby "2.2.2"
gem "rails", "4.2.0"
group :development do
gem "foreman"
gem "guard-livereload", require: false
gem "rack-livereload"
end
@aalvesjr
aalvesjr / gist:91cc4f361b80ca580ab4
Created May 5, 2015 23:35
Net::OpenTimeout (execution expired) exception with Rails mailer
Quando ocorrer esse erro:
altere:
# /etc/sysctl.conf
e acrescente as linhas:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
@hhff
hhff / gist:158a3ac397eb66df6a98
Last active August 19, 2021 18:07
Setting up Spree on Dokku via Digital Ocean
Spree API Server Needs
- Easy Setup & Deployment (Dokku)
- New Relic
- Error Monitoring (Raven)
- Performance Monitoring (Skylight)
- Logging (Loggly or Logentries?)
- SSL (Dokku handles this)
- Database Backups (http://donpottinger.net/blog/2014/11/22/bye-bye-heroku-hello-dokku-part-2.html (See Clockwork section))
- Caching (Memcached + Dalli)
- Worker (Sidekiq)
@mlanett
mlanett / rails http status codes
Last active May 18, 2025 12:44
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
@joshteng
joshteng / dokku_setup.md
Last active August 27, 2024 04:03
Using Dokku to deploy a Rails Application

#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!

##Notes

  • Follow 12 factor design (include the rails_12factor gem)
  • Don't forget your Procfile with the command to start up your application server
  • I prefer using external hosted logging services like Logentries (not in this guide)
  • Set up performance monitoring AppSignal or New Relic (not in this guide)
@vishalzambre
vishalzambre / curl.sh
Last active October 2, 2021 02:30
Using devise gem sign_in & sign_out API's with sessions
#login
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"user":{"email":"<email>","password":"<passwd>"}}' http://localhost:3000/api/v1/sign_in.json
#logout
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:3000/api/v1/sign_out.json?auth_token=<token>
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 12, 2025 01:59
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@stormpython
stormpython / how_to_set_up_ssh_keys.md
Last active March 21, 2025 10:11
Setting up ssh keys for remote server access

How to Set up SSH Keys

Create the RSA Key Pair

ssh-keygen -t rsa

Store the Keys and Passphrase

Once you have entered the Gen Key command, you will get a few more questions:

@mortezaadi
mortezaadi / persistence.xml
Last active July 23, 2024 00:45
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->