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
public static string OpenSslVerify(string publicKeyFile, string signedContent) | |
{ | |
var pkey = new PublicKey(); | |
pkey.LoadOpenSslPemFile(publicKeyFile); | |
string pkeyXml = pkey.GetXml(); | |
var rsa = new Rsa(); | |
bool success = rsa.UnlockComponent("30-day trial"); | |
if (success != true) | |
{ |
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
using System; | |
using System.ComponentModel; | |
using System.Diagnostics.CodeAnalysis; | |
namespace Moq | |
{ | |
[EditorBrowsable(EditorBrowsableState.Never)] | |
public interface IHideObjectMembers | |
{ | |
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", |
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
internal class JobRegistry :Registry | |
{ | |
public JobRegistry() | |
{ | |
ForSingletonOf<PlaynGO.Common.InversionOfControl.IContainer>().Use<PlaynGO.StructureMap.Container>(); | |
ForSingletonOf<IJobFactory>().Use<WpsJobFactory>(); | |
var col = new NameValueCollection(); | |
ForSingletonOf<ISchedulerFactory>().Use<StdSchedulerFactory>().Ctor<NameValueCollection>("props").Is(ctx => | |
{ |
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 |
OlderNewer