Skip to content

Instantly share code, notes, and snippets.

View pawan-yadav's full-sized avatar

Pawan Yadav pawan-yadav

View GitHub Profile
@pawan-yadav
pawan-yadav / server.md
Created March 2, 2017 06:10 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@pawan-yadav
pawan-yadav / contact_batch_email.html.erb
Created February 21, 2017 08:25 — forked from Joseworks/contact_batch_email.html.erb
Send batch emails on ActiveAdmin Rails 4.2.0
<!-- Contact batch email -->
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
</head>
<body>
<div>Name: <%= @name %></div>
<br>
<div>Subject: <%= @subject %></div>
@pawan-yadav
pawan-yadav / gist:bc3b54f4dcbe89cc941de442c6d5a8d2
Created December 29, 2016 12:55 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.