Skip to content

Instantly share code, notes, and snippets.

View sicktastic's full-sized avatar
:octocat:
I may be slow to respond.

Anthony Lee sicktastic

:octocat:
I may be slow to respond.
View GitHub Profile
@sicktastic
sicktastic / nextjs_setup.md
Last active February 24, 2023 21:44
NextJS Setup (2023 Version)
@sicktastic
sicktastic / Procfile.dev
Created April 12, 2021 21:54 — forked from joshuaclayton/Procfile.dev
Rails Procfile.dev for Tailwind + live reloading of views
web: bundle exec puma -C config/puma.rb
webpack: bin/webpack-dev-server
livereload: watchexec -w app/views touch app/javascript/packs/application.js
@sicktastic
sicktastic / gist:005a3ccd4debaba6e911d9044ed6328e
Created February 17, 2021 03:04 — 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.

@sicktastic
sicktastic / notion2blog.js
Created February 2, 2021 08:39 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thrive Ministry Hub</title>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<style type="text/css">
/* Make this awesome on mobile */
@media only screen and (max-device-width: 480px) {
@sicktastic
sicktastic / move_heroku_pg_to_aws_rds.md
Created February 7, 2020 21:57 — forked from halilim/move_heroku_pg_to_aws_rds.md
Move Heroku Postgres to Amazon AWS RDS
  1. Prepare your RDS instance and [authorize access to it][1] (basically make it public).

  2. Put your app in maintenance mode:

    heroku maintenance:on
  3. Save the latest SQL dump of the DB:

@sicktastic
sicktastic / nginx-passenger-ssl.conf
Created March 26, 2019 16:30 — forked from rkjha/nginx-passenger-ssl.conf
Nginx/Passenger config when using SSL with a Ruby/Rails Application.
# for redirecting hhtp traffic to https version of the site
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
# for redirecting to non-www version of the site
server {
listen 80;
window.intercomSettings = {
app_id: "APP_ID",
hide_default_launcher: true,
email: '<%= current_user.email %>',
name: '<%= current_user_full_name %>',
first_name: '<%= current_user.first_name %>',
last_name: '<%= current_user.last_name %>',
user_hash: '<%= OpenSSL::HMAC.hexdigest("sha256", ENV["INTERCOM_SECRET"], current_user.id.to_s) %>',
created: '<%= current_user.created_at %>',
avatar: {
@sicktastic
sicktastic / countries
Created February 5, 2018 07:06 — forked from kalinchernev/countries
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria