Skip to content

Instantly share code, notes, and snippets.

@stevecondylios
stevecondylios / contact-form-rails-6.md
Last active April 2, 2024 15:50
Create a Contact Form in Rails 6

How to make a contact form in rails 6

This is a quick walk through on how to:

  1. make a contact form in rails 6,
  2. test it locally, and
  3. move it into production using heroku and the MailGun addon

This uses the free heroku and mailgun plans. If you get stuck on any part, check the full code here.

@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 \
@AtulKsol
AtulKsol / db_backup_commands.md
Last active April 25, 2024 14:36
Commands to backup & restore database
  1. pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
    Backup: pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sql

    Restore: psql -h localhost -p 5432 -U postgres -d mydb < backup.sql

    -h is for host.
    -p is for port.
    -U is for username.
    -d is for database.

@wafiq
wafiq / rails-5-6-ubuntu-mina-puma-nginx.md
Last active November 27, 2023 02:43
How to deploy Rails 5/6 in Ubuntu VM using Mina deployment with Puma webserver and Nginx

Rails 5 and 6 Deployment with Ubuntu, Mina, Puma and Nginx

Based on this tutorial but simplified and inlined. Particularly removed any Rails and 3rd party services part, assumed you just need deployment to any Ubuntu machine.

Prerequisite

  1. A functional Rails app
  2. Hosted Git repository (Github, Bitbucket, Gitlab)
  3. Cloud hosting account (Digital Ocean, Vultr, Linode, Lightsail)
  4. Local SSH account
@vasanthk
vasanthk / System Design.md
Last active May 5, 2024 00:11
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
==========================
How Software Companies Die
==========================
- Orson Scott Card
The environment that nurtures creative programmers kills management and
marketing types - and vice versa.
Programming is the Great Game. It consumes you, body and soul. When
you're caught up in it, nothing else matters. When you emerge into
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 5, 2024 00:12
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@dideler
dideler / 0-startup-overview.md
Last active May 3, 2024 11:03
Startup Engineering notes
@mdesantis
mdesantis / schedule.rb
Last active May 28, 2023 16:11
Schedule script for using Whenever toghether with rbenv
# Schedule script for using Whenever toghether with rbenv
#
# Whenever: https://github.com/javan/whenever
# rbenv: https://github.com/sstephenson/rbenv
set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"'
# doesn't need modifications
# job_type :command, ":task :output"