Skip to content

Instantly share code, notes, and snippets.

View enum.cs
// Получение значения Enum по строковому имени
//
EnumType dp = EnumType.None;
if(Enum.IsDefined(typeof(EnumType), enumElementName))
dp = (EnumType)Enum.Parse(typeof(EnumType), enumElementName);
else
Console.WriteLine("Sorry, no element exists!");
@lks128
lks128 / 01_paperclip.rb
Created Dec 25, 2012
Paperclip Rails initializer to store data on the European S3 server using Fog.
View 01_paperclip.rb
# config/initializers/01_paperclip.rb
if Rails.env.production?
Paperclip::Attachment.default_options.merge!(
storage: :fog,
fog_directory: 'lazy-enterprise',
fog_host: 'https://s3-eu-west-1.amazonaws.com/lazy-enterprise',
fog_public: true,
fog_credentials: {
provider: 'AWS',