Skip to content

Instantly share code, notes, and snippets.

View DriesS's full-sized avatar

Dries Steenhouwer DriesS

View GitHub Profile
@DriesS
DriesS / widget.tpl
Created January 15, 2014 15:57
Widget in footer
{*
variables that are available:
- {$widgetTestimonialsRandomTestimonial}: contains data about a (random) testimonials
*}
<div class="randomTestimonial">
{option:widgetTestimonialsRandomTestimonial}
<div class="mod testimonial">
<div class="inner">
<blockquote class="bd">{$widgetTestimonialsRandomTestimonial.testimonial}</blockquote>
@DriesS
DriesS / mail.txt
Created January 8, 2014 11:40
Mail not delivered on bbc address
Delivered-To: [email protected]
Received: by 10.112.2.231 with SMTP id 7csp135895lbx;
Thu, 26 Dec 2013 17:27:55 -0800 (PST)
X-Received: by 10.60.65.101 with SMTP id w5mr32239843oes.0.1388107673964;
Thu, 26 Dec 2013 17:27:53 -0800 (PST)
Return-Path: <bounces+81628-0a58-steenhouwer.dries=gmail.com@smtp.destockjeans.fr>
Received: from o1.smtp.zurbanculture.com (o1.smtp.zurbanculture.com. [208.117.51.34])
by mx.google.com with SMTP id us4si25427561obc.18.2013.12.26.17.27.52
for <[email protected]>;
Thu, 26 Dec 2013 17:27:53 -0800 (PST)
@DriesS
DriesS / email.txt
Created January 8, 2014 11:31
email
Delivered-To: [email protected]
Received: by 10.58.4.164 with SMTP id l4csp160457vel;
Fri, 6 Dec 2013 19:52:04 -0800 (PST)
X-Received: by 10.182.196.3 with SMTP id ii3mr5077762obc.11.1386387850488;
Fri, 06 Dec 2013 19:44:10 -0800 (PST)
Return-Path: <[email protected]>
Received: from o1.smtp.zurbanculture.com (o1.smtp.zurbanculture.com. [208.117.51.34])
by mx.google.com with SMTP id jb8si387646obb.27.2013.12.06.19.44.10
for <[email protected]>;
@DriesS
DriesS / notifier.rb
Created January 8, 2014 11:07
code to send email
def prepare_send
@config_support_hostess = AppConfig.company.support_hostess
@company = AppConfig.company.name
@site_name = AppConfig.site.name
@utm_source = AppConfig.site.utm_source
@utm_medium = "email"
@utm_campaign = "#{(caller[0] =~ /`([^']*)'/ and $1)}_#{utm_today} " #super hack that return the method name of the caller
@utm_args = {utm_source: @utm_source, utm_campaign: @utm_campaign, utm_medium: @utm_medium}
end
@DriesS
DriesS / debugger.log
Created January 2, 2014 09:53
Profile search
(rdb:190) profile_search.count
9
(rdb:190) profile_search.size
9
(rdb:190) profile_search
[#<Axohood::Profile id: 89, first_name: "Sarah", last_name: "Vande Walle", address: "Jan Yoensstraat 7", country: nil, province: "vov", postal_code: "9800", city: "Deinze", latitude: 50.9871162, longitude: 3.5432432, gender: "f", gmaps: nil, professional_id: nil, website: "www.psychobegeleiding.be", mobile_phone: "0489 17 54 10", phone: "", fax: "", picture: "", movie_url: "", description: "<p><span style=\"line-height: 1.6em;\">--------------...", created_at: "2013-03-12 08:12:04", updated_at: "2013-10-15 09:57:55", availability: {"friday"=>"{\"morning\"=>{\"start\"=>\"\", \"end\"=>\"\"}, \"lunch\"=>{\"start\"=>\"\", \"end\"=>\"\"}, \"evening\"=>{\"start\"=>\"\", \"end\"=>\"\"}}", "monday"=>"{\"morning\"=>{\"start\"=>\"\", \"end\"=>\"\"}, \"lunch\"=>{\"start\"=>\"\", \"end\"=>\"\"}, \"evening\"=>{\"start\"=>\"\", \"end\"=>\"\"}}", "sunday"=>"{\"morning\"=>{\"start\"=>\"\", \"end\"=>\"\"}, \"lunch\"=>{\"start\"=>\"\", \"
@DriesS
DriesS / 0_output.log
Last active December 31, 2015 05:49
Polymorphic associations
u.recently_viewed_items
[#<ListItem id: 2459209, list_id: 655831, listable_type: "Product", listable_id: 84303, created_at: "2013-12-13 11:19:07", updated_at: "2013-12-13 11:19:07">, #<ListItem id: 2459208, list_id: 655831, listable_type: "Product", listable_id: 84543, created_at: "2013-12-13 11:19:02", updated_at: "2013-12-13 11:19:02">, #<ListItem id: 2459207, list_id: 655831, listable_type: "Product", listable_id: 84403, created_at: "2013-12-13 11:18:57", updated_at: "2013-12-13 11:18:57">, #<ListItem id: 2459206, list_id: 655831, listable_type: "Product", listable_id: 84553, created_at: "2013-12-13 11:18:51", updated_at: "2013-12-13 11:18:51">, #<ListItem id: 2459205, list_id: 655831, listable_type: "Product", listable_id: 84413, created_at: "2013-12-13 11:18:45", updated_at: "2013-12-13 11:18:45">, #<ListItem id: 2459203, list_id: 655831, listable_type: "Product", listable_id: 84373, created_at: "2013-12-13 11:01:49", updated_at: "2013-12-13 11:18:25">]
@DriesS
DriesS / form.html.haml
Created December 13, 2013 10:27
Form in rails is doing a get and not put for some reasons
= form_for @return, :as => :return, :url => refund_admin_return_path(@return), :html => {:method => :put} do |f|
= f.radio_button :refund_type, 'cheque'
= f.radio_button :refund_type, 'manual'
= content_tag(:button, t(:'admin.buttons.returns.confirm_refund'), :type => 'submit', :class => 'btn btn-primary')
# download pictures
execute "download ja s3 pictures" do
command "s3cmd sync -v -r --delete-removed s3://jeansattitude/ /data/s3/zurbanculture/"
action :run
end
execute "download dj s3 pictures" do
command "s3cmd sync -v -r --delete-removed s3://destockjeans/ /data/s3/destockjeans/"
@DriesS
DriesS / test.rb
Created December 6, 2013 09:31
Test raw display
context 'when line_item_description contains special chars' do
let(:description){ "test&nbsp;desc with special chars &eacute; &euml; &auml;" }
subject { line_item_description_text description }
it { should == "test desc with special chars é ë ä"}
end
Spree::BaseMailer.class_eval do
layout 'mail'
end