This file contains 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
if(o.LastAccessed < maxIntegrationTime) { | |
return true; | |
} | |
return false; |
This file contains 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
if ((order.status != :created) and !(User.Current.IsInRole("Admin") | |
{ | |
ViewBag.Alert = "This order cannot be changed since work has begun; | |
Response.Redirect(string.Format("/Orders/", order.Id); | |
} |
This file contains 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
require 'client_side_validations/simple_form' if defined?(::SimpleForm) | |
require 'client_side_validations/formtastic' if defined?(::Formtastic) | |
# Uncomment the following block if you want each input field to have the validation messages attached. | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
unless html_tag =~ /^<label/ | |
%{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe | |
else | |
%{<div class="field_with_errors">#{html_tag}</div>}.html_safe | |
end |
This file contains 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
=semantic_form_for [:admin,@frame], validate: true do |f| | |
=f.inputs do | |
=f.input :collection | |
=f.input :collection_id, as: :select, collection: @collections, label: 'Choose Collection' | |
=f.input :category, as: :select, collection: ['', 'Indoors', 'Outdoors'], label: "Select category" | |
=f.input :name | |
=f.buttons |
This file contains 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
<form accept-charset="UTF-8" action="/orders" class="formtastic order" data-validate="true" id="new_order" method="post" novalidate="novalidate" name="new_order"> | |
<div> | |
<fieldset> | |
<legend><span>Select a Store</span></legend> | |
<ol> | |
<li class="error"> | |
<label for="order_store">Store</label> <select data-validate="true" id="order_store_id" name="order[store_id]"> | |
<optgroup label="Independant"> | |
<option value ="" /> | |
<option value="2"> |
This file contains 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
class ActiveRecord::Base | |
def self.has_statuses(*status_names) | |
validates :status, | |
presence: true, | |
inclusion: { in: status_names.to_s} | |
status_names.each do |status_name| | |
scope "all_#{status_name}", where(status: status_name) | |
end |
This file contains 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
class Dog < ActiveRecord::Base | |
attr_accessible :name, :pictures_attributes | |
has_many :pictures, as: :attachable | |
accepts_nested_attributes_for :pictures | |
end |
This file contains 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
(function() { | |
var gs = document.createElement('script'), gsc = document.createElement('div'), interval; | |
gs.type = 'text/javascript'; gs.async = true; gsc.id = 'getsatisfaction'; | |
gs.src = document.location.protocol + '//s3.amazonaws.com/getsatisfaction.com/javascripts/feedback-v2.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gs); | |
(document.getElementsByTagName('body')[0]).appendChild(gsc); | |
interval = setInterval(function() { | |
if (window.GSFN !== undefined) { | |
new GSFN.feedback_widget({ |
This file contains 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
cd ~ | |
sudo apt-get install unzip | |
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jre sun-java6-plugin -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz |
This file contains 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
// The last parameter is wait and that doesn't work in Windows 7 for some reason. It don't get the completion notification so we wait until the file is ready | |
CrystalExportToFile(sCrystalTemplate,sFile,sTempDir, sCondStr, false, false,'',false); | |
while (fileexists(sTempDir+'\'+sFile,true)<>0) do begin | |
sleep(1000); | |
end; |