Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bambycha on github.
  • I am bambycha (https://keybase.io/bambycha) on keybase.
  • I have a public key ASBlpMorj6_vlqzV1hijnnBU3iDjMDKw3a3yPFtp8Tg4kgo

To claim this, I am signing this object:

@bambycha
bambycha / inherit_model.rb
Created October 1, 2015 15:37
Collection copy
require 'sqlite3'
require 'active_record'
require 'pry'
require "minitest/autorun"
# Connect to an in-memory sqlite3 database
ActiveRecord::Base.establish_connection(
adapter: 'sqlite3',
database: ':memory:'
)
@bambycha
bambycha / rubocop.rb
Last active September 7, 2015 12:36 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
#
# Here are some options you can pass in addition to the ones in rubocop:
#
# --local Check only the changes you are about to push
@bambycha
bambycha / dovecot.conf
Created February 6, 2014 20:46
/etc/dovecot/dovecot.conf
/etc/dovecot# cat dovecot.conf
## Dovecot configuration file
# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration
# "doveconf -n" command gives a clean output of the changed settings. Use it
# instead of copy&pasting files when posting to the Dovecot mailing list.
# '#' character and everything after it is treated as comments. Extra spaces
# and tabs are ignored. If you want to use either of these explicitly, put the
@bambycha
bambycha / TLS_README
Created February 6, 2014 10:51
/usr/share/doc/postfix/TLS_README.gz
Postfix TLS Support
-------------------------------------------------------------------------------
WARNING
By turning on TLS support in Postfix, you not only get the ability to encrypt
mail and to authenticate remote SMTP clients or servers. You also turn on
thousands and thousands of lines of OpenSSL library code. Assuming that OpenSSL
is written as carefully as Wietse's own code, every 1000 lines introduce one
@bambycha
bambycha / main.cf.dist
Created February 5, 2014 14:50
cat /usr/share/postfix/main.cf.dist
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
# list, see the postconf(5) manual page (command: "man 5 postconf").
#
# For common configuration examples, see BASIC_CONFIGURATION_README
# and STANDARD_CONFIGURATION_README. To find these documents, use
# the command "postconf html_directory readme_directory", or go to
# http://www.postfix.org/.
#
# For best results, change no more than 2-3 parameters at a time,
@bambycha
bambycha / gist:8825232
Created February 5, 2014 14:48
cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no