This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Roles Table | |
Role.create([{name:'admin'},{name:'staff'}]) | |
# Users Roles Table | |
UserRole.create(user: User.find_by_username('corndog'), role: Role.find_by_name('admin')) | |
# User Model | |
class User < ApplicationRecord | |
def role?(role) | |
role.kind_of?(Array) ? role.map { |role| has_role?(role) }.any? : has_role?(role) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In a View | |
<%= render 'bookmarks/add_remove', record: @lesson %> | |
# The Partial | |
<% if current_customer && current_customer.bookmarked_content?(record) %> | |
<%= button_to bookmark_path(current_customer.bookmark_for_content(record), bookmarkable_type:record.class.name, bookmarkable_id:record.id), method: :delete, class:'btn btn-sm btn-light box-shadow', form_class:'add-remove-bookmark', data:{disable_with:'Removing...'}, remote: true do %> | |
<%= ms_icon('minus-circle', title:'Unsave This') %> | |
<% end %> | |
<% else %> | |
<%= button_to bookmarks_path(bookmarkable_type:record.class.name, bookmarkable_id:record.id), method: :post, class:'btn btn-sm btn-light box-shadow', form_class:'add-remove-bookmark', data:{disable_with:'Adding...'}, remote: true do %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Checkups::Notify | |
require 'slack-notify' | |
class Dispatch | |
def initialize(params) | |
@message = params[:message] | |
@room = params[:room] || '#web-dev_events' | |
@botname = params[:botname] || 'EDU Bot' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.omniauth :wordpress_hosted, ENV['SSO_KEY'], ENV['SSO_SECRET'], | |
strategy_class: OmniAuth::Strategies::WordpressHosted, | |
client_options: { site: ENV['SSO_URL'] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Lasso Sample Settings Addon | |
* | |
*/ | |
add_filter('lasso_modal_tabs','try_tabs'); | |
function try_tabs( $tabs ){ | |
$tabs[] = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.lead { | |
font-size: 1.3em; | |
font-weight: 200; | |
line-height: 1.6; | |
&.dropcap:first-letter { | |
float: left; | |
font-size: 3.4rem; | |
line-height: 2rem; | |
padding-top: 1.2rem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this targets 1,5,7,11,13,17,19... | |
.ale--66 { | |
&:nth-child(6n+1), | |
&:nth-child(6n+5){ | |
width:66.666%; | |
} | |
} | |
// this targets - 2,4,8,10,14,16,20.... | |
.ale--33 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('ideas','ideas_shortcode'); | |
function ideas_shortcode(){ | |
ob_start(); | |
$args = array( | |
'post_type' => 'ideas', | |
'posts_per_page' => -1 | |
); | |
$q = new WP_Query($args); |