Skip to content

Instantly share code, notes, and snippets.

View ericalli's full-sized avatar
🎯
Focusing on @getsiimple

Eric Alli ericalli

🎯
Focusing on @getsiimple
View GitHub Profile
@ericalli
ericalli / USER_AUTH_RAILS_EXAMPLE.md
Created May 24, 2020 08:14 — forked from mdang/USER_AUTH_RAILS_EXAMPLE.md
Lesson: User Auth (Rails Example)

User Auth with Rails (The Fun Way)

Starting a new project

$ rails new user_auth --database=postgresql
$ cd user_auth
@ericalli
ericalli / user_association.rb
Created May 24, 2020 08:12
Adding User Association to Any Table
rails generate migration AddUserRefToProducts user:references
class AddUserRefToProducts < ActiveRecord::Migration[6.0]
def change
add_reference :products, :user, foreign_key: true
end
end
# MyApp/app/controllers/products_controller.rb
<script>
// Custom configration for Dandelion theme
var themeConfig = {
// The API key for your Ghost blog
ghostSearchKey: 'xxxx',
// Custom taglines for the 'Subscribe' section of your homepage (if subscribers are enabled), comma separated
newsletterTaglines: ['My first tagline', 'My second tagline', 'My third tagline'],
// Your disqus username (leave blank for no comments)
@ericalli
ericalli / wp.sh
Created July 12, 2017 05:06 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
var images = [
{
"726":['photo5.jpeg','photo6.jpeg']
},
{
"768":['photo2.png','photo3.png','photo4.png','photo3.png','photo1.png']
}
];
div.tabs ul.ui-tabs-nav li.ui-state-active a { padding-bottom: 26px; }
div.tabs ul.ui-tabs-nav li a { padding: 25px 50px 25px 50px; }
<% if @facility.has_admin(@current_user) %>
<div id="profile_link" class="box">
<div class="title">
<h4>
<%= icon_tag "link" %>
Share Facility
</h4>
</div>
<div class="content">
<span><input type="radio" name="link_type" class="checkbox" value="link" checked="checked" data-value="<%= facility_url(@facility) %>" /> Facility Link</span>
// Import the following into your HTML
jquery.event.drag-2.2.js
jquery.event.drop-2.2.js
jquery.roundabout-shapes.min.js
jquery.roundabout.min.js
// Goes in watercolor.js
defaults: &defaults
api_key: r9g5t9reg09ergj
development:
<<: *defaults
test:
<<: *defaults
staging:
jQuery(window).load(function () {
jQuery("a.calendar_list").trigger("click");
});