Skip to content

Instantly share code, notes, and snippets.

View lilithlavender's full-sized avatar
🦄
[hacking in progress]

Dannie Soskel lilithlavender

🦄
[hacking in progress]
View GitHub Profile
class Franchisee < ActiveRecord::Base
belongs_to :user
has_many :phone_numbers, as: :phoneable, dependent: :destroy
accepts_nested_attributes_for :phone_numbers, allow_destroy: true
validates :region_code, presence: true
end
@lilithlavender
lilithlavender / gist:7605320
Created November 22, 2013 19:18
I have a client using our app who needs to be able to parse emails sent as raw text. Other clients prefer HTML formatting. When I have rails send a multipart message it defaults to inserting HTML first, and the client's program can't parse the result. I have correctly created templates for both html.erb and text.erb in the views for this mailer.…
def new_information_request(information_request)
@franchise = information_request.franchise
@franchisee = information_request.franchisee
to = @franchise.lead_emails
subject = "#{TENANT['email_prefix']} New Lead"
mail(to: to, subject: subject ) do |format|
format.text
format.html
end
def find_author(context)
context.present? && context.to_i != 0 ? @authors[context.to_i][:email] : nil
end
class FranchiseeRequest < ActiveRecord:: Base
attr_accessor :skip_region_validation
attr_accessor :skip_region_validation, as: :import
validate :expanding_into_region, unless: :skip_region_validation
def expanding_into_region
raise error if franchise is not expanding into current region
end
<?php if($comments) : ?>
<?php foreach($comments as $comment) : ?>
<div class="row">
<div class="col-md-2">
<img src="<?php bloginfo('template_directory'); ?>/images/placeholder.png" alt="" class="img-circle comment-author-img">
</div> <!-- end col-md-2 -->
<div class="col-md-10">
<div class="post-comment">
<p class="comment-info"><strong><?php comment_author(); ?></strong> / <span class="comment-time"><?php comment_date('M j'); ?> at <?php comment_time('G:i'); ?></span> / <a href="#">Reply</a></p>
<p><?php comment_text(); ?></p>
/* Dark Matter Reloaded
* Version 2 - 02/25/2014
*
* Author: @xupisco - xupisco.net */
/* Square corners, pls */
* {
border-radius: 0 !important;
border-top-right-radius: 0 !important;
border-top-left-radius: 0 !important;
<div class="chat_line">
<span class="message">
<span class="author"></span>
<span class="content"></span>
</span>
</div>>
function createReport(form) {
var success_message;
success_message="Your report will be emailed to you once complete.";
document.getElementById('messageBox').style.color="#4f8a10";
document.getElementById('messageBox').style.backgroundColor="#dff2bf";
document.getElementById('messageBox').innerHTML=success_message;
document.getElementById('messageBox').style.visibility="visible";
document.getElementById('kdgreportselection').innerHTML="";
document.getElementById('kdgreportselection').style.visibility="hidden";
$.post('report/KDGReport_createreport.php', $(form).serialize(),
@lilithlavender
lilithlavender / apperling results
Last active August 29, 2015 14:24
this bheavior is apperling
<body>
<ul>
<li>amariipb</li>
<ul>
<li>Disks<li>
<ul>
</ul>
<li>ARRAY(0x1ce7210)</li>
<li>ARRAY(0x1ce7c00)</li>
<li>ARRAY(0x1cebb50)</li>
@lilithlavender
lilithlavender / RapperAlphabet.md
Created January 29, 2016 16:36 — forked from gpspake/RapperAlphabet.md
An alphabet composed of rappers with a pronounced single letter in their names