Skip to content

Instantly share code, notes, and snippets.

View BrandonMathis's full-sized avatar
🌸
me like code

BrandonMathis BrandonMathis

🌸
me like code
View GitHub Profile
(ns storefront.color-swap
(:require [storefront.drawing]
[storefront.helpers :refer :all]
[quil.core :as q])
(:import [storefront.drawing Drawing]))
(def pixel-size 30)
(def pixel-count 5)
(defn blend-pixels [x y dx dy effect]
<?xml version="1.0" encoding="UTF-8"?>
<!--Copyright 2009, Machinery Information Management Open Systems Alliance, All Rights Reserved-->
<CCOMData xmlns="http://www.mimosa.org/osa-eai/v3-2-3/xml/CCOM-ML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ValidNetwork>
<GUID>5b41e634-c6cb-4fd7-952e-de7d754d4d85</GUID>
<Network>
<GUID>c83a7e16-3c1a-4ab9-872a-e68785f64ea8</GUID>
<Tag>70e346bb-915d-43d2-ae12-51b46b2ffe0eNetwork Type Taxonomy</Tag>
<Name>Enterprise Classification Taxonomy</Name>
<Network>
<?xml version="1.0"?>
<!--Copyright 2004-2008, Machinery Information Management Open Systems Alliance, All Rights Reserved-->
<mim_cris_v32 xmlns="http://www.mimosa.org/TechXMLV3-2">
<!--row_status_type-->
<row_status_type rstat_type_cod="1" name="Active" gmt_last_updated="1995-12-28T18:00:00" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1"></row_status_type>
<row_status_type rstat_type_cod="2" name="Inactive" gmt_last_updated="1995-12-28T18:00:00" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1"></row_status_type>
<row_status_type rstat_type_cod="3" name="Soft Deleted" gmt_last_updated="1995-12-28T18:00:00" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1"></row_status_type>
<!-- more and more of the same -->
</mim_cris_v32>
class Order::PurchaseService
attr_accessor :cart, :user, :credit_card
def initialize(cart, user, credit_card)
@cart = cart
@user = user
@credit_card = credit_card
end
def perform
class Order
has_one :user
has_one :shipping_address
has_one :credit_card
has_many :line_items
def from_cart(cart)
(...)
end
...
def purchase
@cart = current_user.cart
@order = transform_cart_into_order(@cart)
@order.calculate_tax!
@order.calculate_shipping!
@order.send_order_request_to_warehouse!
@order.email_invoice_to_user(current_user)!
end
(ns roman.core)
(def numerals
`((500 "D")
(400 "CD")
(100 "C")
(90 "XC")
(50 "L")
(40 "XL")
(10 "X")
#[derive(PartialEq, Debug)]
pub struct Roman
{
numeral: String,
}
impl<'a> PartialEq<Roman> for &'a str {
fn eq(&self, roman: &Roman) -> bool {
self == &roman.numeral
defmodule Romanize do
@map [
{ "D", 500 },
{ "CD", 400 },
{ "C", 100 },
{ "L", 50 },
{ "XL", 40 },
{ "X", 10 },
{ "IX", 9 },
{ "V", 5 },
.section { color: #000; }
.section--red { background-color: #F00; }
.section--sm { padding: 1em; }
.section--med { padding: 2em; }
.section--lg { padding: 3em; }
.section--xl { padding: 4em; }