Skip to content

Instantly share code, notes, and snippets.

View mayra-cabrera's full-sized avatar
💃
Nothing to do here. Go to https://gitlab.com/mayra-cabrera instead

Mayra Cabrera mayra-cabrera

💃
Nothing to do here. Go to https://gitlab.com/mayra-cabrera instead
View GitHub Profile
@mayra-cabrera
mayra-cabrera / gist:7586523
Last active December 29, 2015 00:29
Parts!
Spree::Product.find(10).assembly?
Spree::Product Load (0.9ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = $1 LIMIT 1 [["id", 10]]
Spree::Variant Load (0.9ms) SELECT "spree_variants".* FROM "spree_variants" INNER JOIN "spree_assemblies_parts" ON "spree_variants"."id" = "spree_assemblies_parts"."part_id" WHERE "spree_assemblies_parts"."assembly_id" = 10
=> true
Spree::Product.find(10).parts
Spree::Product Load (1.1ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = $1 LIMIT 1 [["id", 10]]
Spree::Variant Load (0.7ms) SELECT "spree_variants".* FROM "spree_variants" INNER JOIN "spree_assemblies_parts" ON "spree_variants"."id" = "spree_assemblies_parts"."part_id" WHERE "spree_assemblies_parts"."assembly_id" = 10
=> [#<Spree::Variant id: 14, sku: "C3", price: #<BigDecimal:7fd289b39148,'0.7495E2',18(18)>, weight: nil, height: nil, width: nil, depth: nil, deleted_at: nil, is_master: true, product_id: 12, count_on_hand: -425, cost_price:
#Product, Variants & Parts
Spree::Product.find(42)
=> #<Spree::Product id: 42, name: "Manager & Supervisor Due Diligence", course_id: 3....>
Spree::Product.find(42).parts
=> [#<Spree::Variant id: 14, sku: "C3", .. is_master: true, product_id: 12, course_id: nil...>,
#<Spree::Variant id: 46, sku: "Confined-2", ... is_master: false, product_id: 11, course_id: nil...>
Spree::AssembliesPart.where(assemblie_id: 42)
=> [#<Spree::AssembliesPart assembly_id: 42, part_id: 14, count: 2>,
#<Spree::AssembliesPart assembly_id: 42, part_id: 46, count: 2>]
=> myLayout
=> #<Rfm::Layout:0x007fc2cd0d67a8
@db=
#<Rfm::Database:0x007fc2cd0dd940
@account_name="",
@layout={"starsv2"=>#<Rfm::Layout:0x007fc2cd0d67a8 ...>},
@name="STARSv2",
@name="STARSv2",
@password="tGr5^M%34s",
@script={},
Con refinery
<article class='motto box box-light-yellow'>
<div class='container'>
<img alt="Lightbulbs" id="lightbulbs" src="/assets/lightbulbs.png" />
<h2><span class="centered text-align-center">Customized, Missional Internships</span>
</h2>
<p class="centered">70% of Christ’s followers live in the Global South.<br />70% of Christ’s followers live in the Global South.<br />70% of Christ’s followers live in the Global South.</p>
</div>
</article>
Con refinery
<article class='box box-green' id='search_projects'>
<div class='container'>
<h2 class='center medium'><p>Don’t see your field?<br />Search all of our projects. Boom, its that easy.</p></h2>
<button class=" button button-orange" id="search-projects"> <span class="sprite search"
title=""
style="background:
url(/assets/spritesheet.png) no-repeat -0px -72px;
width: 32px;
@mayra-cabrera
mayra-cabrera / gist:8326980
Last active January 2, 2016 15:59
IPO Homepage comparison using Refinery
Header:
-Normal http://i1.minus.com/iYdsNVNWE5ZYf.png
-Refinery http://i1.minus.com/ibcoXsj3gzy4bc.png
Customized internships:
http://i5.minus.com/i98qAQS76VfJl.png
Search project
http://i5.minus.com/ib25kzZVs1FXEW.png
@mayra-cabrera
mayra-cabrera / gist:8693293
Created January 29, 2014 17:55
Offerings
{"offeringid"=>"O448",
"created"=>Tue, 02 Apr 2013 11:04:20 +0000,
"modified"=>Tue, 10 Dec 2013 10:04:10 +0000,
"name"=>"Incident Investigation - Online French (51-100)",
"code"=>"OL-AI",
"description"=>"Online Incident Investigation Frenc (51-100) units",
"product_id"=>"29",
"baseprice"=>#<BigDecimal:7f8151c2b4b8,'0.2595E2',18(18)>,
"duration"=>#<BigDecimal:7f8151c31570,'0.4E1',9(18)>,
"outline"=>nil,
[5] pry(#<Spree::Admin::OfferingsController>)> courses = call_stars_script('wsCourses')
http://68.179.44.140:80/fmi/xml/fmresultset.xml?-db=STARSv2&-findall=&-lay=STARSv2&-script=wsCourses&-script.param
date: ["Thu, 30 Jan 2014 15:43:31 GMT"]
set-cookie: ["WPCSessionID=\"HzrvmHdhz0f00PX3R5BG4g==\"; Version=1; Path=/fmi/xml"]
content-type: ["text/xml;charset=UTF-8"]
transfer-encoding: ["chunked"]
<?xml version ="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE fmresultset PUBLIC "-//FMI//DTD fmresultset//EN" "http://68.179.44.140:80/fmi/xml/fmresultset.dtd"><fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"><error code="0"></error><product build="10/22/2013" name="FileMaker Web Publishing Engine" version="13.0.1.216"></product><datasource database="STARSv2" date-format="MM/dd/yyyy" layout="ws_Courses" table="Courses" time-format="HH:mm:ss" timestamp-format="MM/dd/yyyy HH:mm:ss" total-count="366"></datasource><metadata><field-definition auto-enter="yes" four-digit-year="no" global="no
# Trial URL
class TrialUrl < ActiveRecord::Base
scope :for_sales_rep, ->(sales_rep_id) { where(sales_rep_id: sales_rep_id) }
belongs_to :sales_rep, class_name: "OleCore::Login", foreign_key: "sales_rep_id"
end
# Login
module OleCore
Login.class_eval do
# Chrome
[7] pry(#<Jhsc::SurveysController>)> request.env["HTTP_ACCEPT"]
=> "*/*"
[8] pry(#<Jhsc::SurveysController>)> request.env["HTTP_ACCEPT_HEADER"]
=> nil
[9] pry(#<Jhsc::SurveysController>)> request.format
=> */*
self.formats
=> [:html,
:text,