Skip to content

Instantly share code, notes, and snippets.

View timmatheson's full-sized avatar
💭
Seeking new roles

Tim Matheson timmatheson

💭
Seeking new roles
View GitHub Profile
@timmatheson
timmatheson / ruby-to-rust-cheat-sheet.md
Created September 4, 2024 04:49 — forked from styd/ruby-to-rust-cheat-sheet.md
Ruby to Rust Cheat Sheet

Ruby to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in Ruby and Rust so that programmers most comfortable with Ruby can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

Ruby:

let domainMispellings = [
{"gmial.com" : "gmail.com"},
{"gmale.com" : "gmail.com"},
{"gmmail.com" : "gmail.com"},
{"gmaill.com" : "gmail.com"},
{"gmaik.com" : "gmail.com"},
{"gnail.com" : "gmail.com"},
{"yagoo.com" : "yahoo.com"},
{"yahooo.com" : "yahoo.com"},
{"yaho.com" : "yahoo.com"},
let domainMispellings = [
{"gmial.com" : "gmail.com"},
{"gmale.com" : "gmail.com"},
{"gmmail.com" : "gmail.com"},
{"gmaill.com" : "gmail.com"},
{"gmaik.com" : "gmail.com"},
{"gnail.com" : "gmail.com"},
{"yagoo.com" : "yahoo.com"},
{"yahooo.com" : "yahoo.com"},
{"yaho.com" : "yahoo.com"},
/*
Fixes Shopify Empire Theme Image Height
*/
.productitem--image img{
max-height: 200px;
max-width: auto;
}
{"id"=>5425030853, "variant_id"=>11514336837, "title"=>"AMMO-8 (250g)", "quantity"=>2, "price"=>"39.95", "grams"=>0, "sku"=>"", "variant_title"=>"Power Punch", "vendor"=>"Advanced Genetics", "fulfillment_service"=>"manual", "product_id"=>3878106053, "requires_shipping"=>true, "taxable"=>true, "gift_card"=>false, "name"=>"AMMO-8 (250g) - Power Punch", "variant_inventory_management"=>"shopify", "properties"=>nil, "product_exists"=>true, "fulfillable_quantity"=>2, "total_discount"=>"0.00", "fulfillment_status"=>nil, "tax_lines"=>[{"title"=>"CA State Tax", "price"=>"5.99", "rate"=>0.075}, {"title"=>"Orange County Tax", "price"=>"0.40", "rate"=>0.005}], "origin_location"=>{"id"=>1189499269, "country_code"=>"CA", "province_code"=>"BC", "name"=>"Active8 Canada", "address1"=>"2323 Boundary Rd.", "address2"=>"107", "city"=>"Vancouver", "zip"=>"V5M4W5"}, "destination_location"=>{"id"=>1152840965, "country_code"=>"US", "province_code"=>"CA", "name"=>"Tim Matheson", "address1"=>"106 East Bay Ave.", "address2"=>"14", "cit
a.ae_tab{right: 0 !important; left: auto !important; }
{% include 'recently-viewed' %}
<!-- Ajax API -->
{{ '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | script_tag }}
{{ 'api.jquery.js' | shopify_asset_url | script_tag }}
<style type="text/css">
#rv__recent_products.rv__grid{width: 100%; margin-top: 20px;}
.rv__grid .row{ display: block; clear: both;}
.rv__grid .rv__row .rv__column{ float: left; }
.rv__grid .rv__row .rv__column.rv__one{ width: 8.3%; }
.rv__grid .rv__row .rv__column.rv__two{ width: 16.66%; }
<h5>Description</h5>
<div>
[CONTENT HERE]
</div>
<h5>Features</h5>
<div>
[CONTENT HERE]
</div>
<h5>Description</h5>
<div>
[CONTENT HERE]
</div>
<h5>Features</h5>
<div>
[CONTENT HERE]
</div>