Skip to content

Instantly share code, notes, and snippets.

@antun
antun / migrate_users_to_paperclip.rb
Created October 2, 2012 04:44
Rails migration for switching from file_column to paperclip.
require 'fileutils'
class MigrateUsersToPaperclip < ActiveRecord::Migration
def up
# Rename the old "mugshot" column to "old_file_name", since User.mugshot will now try to do Paperclip stuff
rename_column :users, :mugshot, :old_file_name
# Rename asset directories to pluralize
File.rename("public/system/user","public/system/users")
@antun
antun / csv2xlsx.py
Last active August 29, 2015 13:58 — forked from konrad/csv2xlsx.py
#!/usr/bin/env python
"""
FUNCTION: Converts a CSV (tab delimited) file to an Excel xlsx file.
Copyright (c) 2012, Konrad Foerstner <konrad@foerstner.org>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.