This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imaging you have a form that represents a Wall. | |
<%= content_tag :h2, t(:wall).capitalize %> | |
<%= simple_form_for @wall do |f| %> | |
<%= f.hidden_field :current_units %> | |
<%= f.input :direction, :as => :select, :collection => @directions, :value_method => :code, :label_method => label_method, :include_blank => false %> | |
<%= field_set_tag t(:construction).capitalize do %> | |
<%= f.input :wall_type, :as => :select, :collection => @wall_types, :value_method => :code, :label_method => label_method, :include_blank => false, :input_html => {:class => 'initial_field'} %> | |
<%= f.input :lintel_type, :as => :select, :collection => @lintel_types, :value_method => :code, :label_method => label_method, :include_blank => false %> | |
<%= f.input :corners, :input_html => {:size => 10, :class => 'number_field'} %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOGIN="<your DNSimple login here>" | |
TOKEN="<your API token here>" | |
DOMAIN_ID="<your domain id here - use /domains to find it>" | |
RECORD_ID="<your record id here - use /domains/:domain_id/records to find it>" | |
IP="`curl http://icanhazip.com/`" | |
curl -H "Accept: application/json" \ | |
-H "X-DNSimple-Token: $LOGIN:$TOKEN" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this in application.rb before your app is initialized | |
module Kernel | |
def require_and_print(string) | |
puts string | |
require_original(string) | |
end | |
alias_method :require_original, :require | |
alias_method :require, :require_and_print | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
a.link{margin:0;padding:0;border:none;text-decoration:none;} | |
</style> | |
<br /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="format-detection" content="telephone=no"> | |
<table width='320' id="sig" cellspacing='0' cellpadding='0' border-spacing='0' style="width:320px;margin:0;padding:0;"> | |
<tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
images = Spree::Image.all.reject do |image| | |
begin | |
open image.attachment.url | |
putc '.' | |
true | |
rescue | |
puts image.attachment.url | |
false | |
end | |
end |
OlderNewer