Skip to content

Instantly share code, notes, and snippets.

View JonCrawford's full-sized avatar
🏗️
Helping startups on product, tech & data analytics

Jonathan Crawford JonCrawford

🏗️
Helping startups on product, tech & data analytics
View GitHub Profile
/* =General
----------------------------------------------*/
body {
margin: 0 auto;
font-size: 13px;
line-height:1.5;
background-position:center top;
}
#wrapper {
/*----------------------------------------------------------------------------------------
= USER BAR
------------------------------------------------------------------------------------------*/
#user_bar {
height: 25px;
margin-right:10px;
position:absolute;
top:0;
width:572px;
right:10px;
actionmailer (2.1.0, 1.3.6, 1.3.3)
actionpack (2.1.0, 1.13.6, 1.13.3)
actionwebservice (1.2.6, 1.2.3)
activerecord (2.1.0, 1.15.6, 1.15.3)
activeresource (2.1.0)
activesupport (2.1.0, 1.4.4, 1.4.2)
acts_as_ferret (0.4.1)
aws-s3 (0.5.1, 0.5.0)
builder (2.1.2)
capistrano (2.4.3, 2.0.0)
module PrintingHelper
def other_position
["Left Sleeve","Right Sleeve","Left Side", "Right Side",["Other (explain in notes)","Other"]]
end
def position_options(selected = nil, prompt = nil)
groups = ["Front Tshirt", "Back Tshirt", "Other"]
options = [
["Full Front","Center Chest","Left Breast","Right Breast", "Lower Left", "Lower Right", "Lower Center"],
def american_apparel_2001_colors
["Aqua","Army","Ash Grey (no xs)","Ash White Stripe (no xs)","Asphalt","Baby Blue","Black","Brown","Cranberry",
"Creme","Eggplant","Forest","Fuchsia","Gold","Grass","Heather Grey ","Kelly Green ","Lapis (no xs)","Lemon",
"Light Blue","Light Pink","Lime","Mint","Navy","New Silver","Olive","Orange","Pink","Purple","Raspberry ",
"Red","Royal Blue","Sea Foam ","Slate","Teal","White"]
end
def american_apparel_girls_colors
["Aqua","Army (no 2xl)","Ash Grey (no 2xl)","Ash White Stripe (no 2xl)","Asphalt(no 2xl)","Baby Blue","Black",
<div class="product_row add_new_product" id="new_design">
<a href="#" onclick="try {
new Insertion.Before(&quot;new_design&quot;, &quot;\n&lt;div class=\&quot;product_row add_new_product\&quot; id=\&quot;new_product\&quot;&gt;\n &lt;a href=\&quot;#\&quot; onclick=\&quot;try {\nnew Insertion.Before(&quot;new_product&quot;, &quot;&lt;p&gt;This works.&lt;/p&gt;&quot;);\n} catch (e) { alert('RJS error:\\n\\n' + e.toString()); alert('new Insertion.Before(\\&quot;new_product\\&quot;, \\&quot;&lt;p&gt;This works.&lt;/p&gt;\\&quot;);'); throw e }; return false;\&quot;&gt;Add another product&lt;/a&gt;&lt;/div&gt;&quot;);
} catch (e) { alert('RJS error:\n\n' + e.toString()); alert('new Insertion.Before(\&quot;new_design\&quot;, \&quot;\\n&lt;div class=\\\&quot;product_row add_new_product\\\&quot; id=\\\&quot;new_product\\\&quot;&gt;\\n &lt;a href=\\\&quot;#\\\&quot; onclick=\\\&quot;try {\\nnew Insertion.Before(&quot;new_product&quot;, &quot;&lt;p&gt;This works.&lt;/p&gt;&quot;);\\n} catch (e) { alert(\'
def optgroups_with_options(groups, options, selected = nil, prompt = nil)
return "<option>Error: Sizes don't match.</option>" if groups.size != options.size
str = String.new
unless prompt.nil?
if prompt.is_a? String
str += content_tag :option, prompt, :value => ""
elsif prompt.is_a? Array
str += content_tag( :option, prompt[0], :value => prompt[1])
end
end
## Tests
def test_grouped_options_for_select_with_array
assert_dom_equal(
"<optgroup label=\"North America\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
grouped_options_for_select([
["North America",
[['United States','US'],"Canada"]],
["Europe",
[["Great Britain","GB"], "Germany"]]
])
str = "So don't return this (but do return this)"
start = str.index("(")+1
stop = str.rindex(")")-1
str[start..stop]
$ gem install bleak_house
Building native extensions. This could take a while...
ERROR: Error installing bleak_house:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install bleak_house
extconf.rb:3:in `exec': No such file or directory - ruby-bleak-house build_snapshot.rb (Errno::ENOENT)
from extconf.rb:3