Skip to content

Instantly share code, notes, and snippets.

@c80609a
c80609a / suit.rb
Created April 29, 2015 00:54
activeAdmin, carrierwave, has_many files, reject_if attributes NOT present, allow_destroy
require "babosa"
class Suit < ActiveRecord::Base
has_and_belongs_to_many :complects
has_and_belongs_to_many :special_props
has_many :checkins, :dependent => :destroy
has_many :items, :through => :checkins
has_many :suit_photos
accepts_nested_attributes_for :suit_photos,
@c80609a
c80609a / suits.rb
Last active August 29, 2015 14:20
activeAdmin, carrierwave, has_many files, reject_if attributes NOT present, allow_destroy
ActiveAdmin.register Suit do
menu :parent => "Мебель",
:label => "Комплекты"
permit_params :title,
:color,
:material,
:material_front,
:price,
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
@c80609a
c80609a / site.conf
Last active September 11, 2015 11:53
site.conf
server {
listen 80;
server_name <...>.com;
passenger_enabled on;
passenger_start_timeout 180;
passenger_load_shell_envvars off;
root /home/webmaster/git/bitbucket/s40/public;
client_max_body_size 32m;
location / {
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
@c80609a
c80609a / $ nginx -V
Created September 14, 2016 05:56
nginx 1.11.3
$ nginx -V
nginx version: nginx/1.11.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments:
--prefix=/usr/share/nginx
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
@c80609a
c80609a / Postfix master process configuration file
Created September 14, 2016 06:06
Postfix master process configuration file
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
@c80609a
c80609a / postfix main.cf
Created September 14, 2016 06:08
postfix main.cf
soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
# The default_privs parameter specifies the default rights used by
# the local delivery agent for delivery to external file or command.
# These rights are used in the absence of a recipient user context.
# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
@c80609a
c80609a / cyrus.conf
Created September 14, 2016 06:13
cyrus.conf
# standard standalone server implementation
START {
# do not delete this entry!
recover cmd="ctl_cyrusdb -r"
# this is only necessary if using idled for IMAP IDLE
idled cmd="idled"
}
require 'mini_magick'
class Walker
def initialize
@filenames = []
end
def walk(dirname)