Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcin Stecki madsheep

View GitHub Profile
@madsheep
madsheep / nginx.conf
Created Oct 21, 2014
full nginx config
View nginx.conf
ssl on;
ssl_certificate /opt/nginx/certs/domain.crt;
ssl_certificate_key /opt/nginx/certs/domain.key;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@madsheep
madsheep / nginx.con
Created Oct 21, 2014
cache & headers
View nginx.con
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
underscores_in_headers on;
View nginx.conf
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
ssl_prefer_server_ciphers on;
@madsheep
madsheep / nginx.conf
Last active Aug 29, 2015
sample nginx ssl config
View nginx.conf
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@madsheep
madsheep / membership.rb
Created May 19, 2014
not simple at all
View membership.rb
class Membership
belongs_to :user
belogns_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
Resque.enqeue(NotificationMailerWorker, self.id, user.id)
Resque.enqeue(PushNotifcations::NewMembershipWorker, self.id, user.id)
@madsheep
madsheep / membership.rb
Created Apr 29, 2014
not simple at all
View membership.rb
class Membership
belongs_to :user
belogns_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
Resque.enqeue(NotificationMailerWorker, self.id, user.id)
Resque.enqeue(PushNotifcations::NewMembershipWorker, self.id, user.id)
@madsheep
madsheep / membership.rb
Last active Aug 29, 2015
less and less simple
View membership.rb
class Membership
belongs_to :user
belogns_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
Resque.enqueue MembershipNotificationsWorker, self.id
end
View membership.rb
class Membership
belongs_to :user
belogns_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
NotificationMailer.accepted(self, user).deliver!
PushNotifcations::NewMembership.new(self, user).dispatch!
View membership.rb
class Membership
belongs_to :user
belogns_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
NotificationMailer.accepted(self, user).deliver!
PushNotifcations::NewMembership.new(self, user).dispatch!
View membership.rb
class Membership
belongs_to :user
belongs_to :group
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? }
def send_notifications
NotificationMailer.accepted(self, user).deliver!
NotificationMailer.accepted_admin(self, group.admin).deliver!
You can’t perform that action at this time.