Skip to content

Instantly share code, notes, and snippets.

View feldpost's full-sized avatar

Sebastian Friedrich feldpost

View GitHub Profile
@feldpost
feldpost / env.sample.js
Last active August 29, 2015 14:10 — forked from obra/env.sample.js
module.exports = {
pivotal: {
TOKEN: 'TOKEN'
PID: 'PID',
},
sprintly: {
USER: "USER_EMAIL",
ID: 'PRODUCT_ID',
KEY: 'API_KEY'
},
# Run rake db:size to get a print of your database size in bytes.
# Run rake db:tables:size to get the sizes for individual tables
# Works for MySQL and PostgreSQL. Not tested elsewhere.
namespace :db do
desc 'Print data size for entire database'
task :size => :environment do
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
adapter = ActiveRecord::Base.connection.adapter_name.downcase
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
# When a spammer wants to attack your site, they'll likely send an automated bot
# that will blindly fill out any forms it encounters. The idea of a "honeypot" is that
# you place a hidden field in a form. That's the honeypot. If this field is filled in, then
# it's almost certain to be a spammer (since a normal user wouldn't have even seen the
# field), and the contents of the form can safely be discarded.
# Normally, you would implement a "honeypot" in a Rails app with some combination of a
# special field in a particular form, and then some logic in the corresponding controller that
# would check for content in the "honeypot" field. This is somewhat of an inefficient
# approach, because it requires special code (not DRY), and bots are still going through an