This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attr_serialized_on(column, *attributes) | |
attributes.each do |a| | |
class_eval do | |
define_method(a) { meta(a) } | |
define_method(a.to_s + "=(value)") { metadata[a] = value } | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
include Authentication | |
# The rest of your codes go here | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<%= yield_page_info %> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update: Looks for the SQLite and SQLite3 adapters for | |
# compatibility with Rails 1.2.2 and also older versions. | |
def in_memory_database? | |
if ENV["RAILS_ENV"] == "test" and | |
(Rails::Configuration.new.database_configuration['test']['database'] == ':memory:' or | |
Rails::Configuration.new.database_configuration['test']['dbfile'] == ':memory:') | |
begin | |
if ActiveRecord::Base.connection.class == ActiveRecord::ConnectionAdapters::SQLite3Adapter | |
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
require 'fileutils' | |
config_opts = ["--with-jpeg=no", "--with-gif=no", "--with-tiff=no", "--with-ns"] | |
source_dir = "#{ENV['HOME']}/src" | |
repo_dir = "#{source_dir}/emacs" | |
#install_dir = "#{repo_dir}/nextstep/Emacs.app" | |
#install_target = "/Applications/Emacs.app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; font-size.el -- font zoomer | |
;; code from Ola Bini: http://ola-bini.blogspot.com/2006/11/emacs-diversion-font-sizes.html | |
;; replaced fonts with OSX fonts | |
(defun inc-font-size () | |
(interactive) | |
(let* ((current-font (cdr (assoc 'font (frame-parameters)))) | |
(splitted (split-string current-font "-")) | |
(new-size (+ (string-to-number (nth 7 splitted)) 1)) | |
(new-font (concat (nth 0 splitted) "-" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.notice, | |
div.warning, | |
div.error { | |
font-size: 18px; | |
padding: 15px 10px; | |
margin-bottom: 10px; | |
} | |
div.notice span, | |
div.warning span, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div#Header { | |
background: #4E9FCF !important; | |
color:#fff !important; | |
} | |
div.SidebarReminder h2 { | |
color: #4E9FCF !important; | |
} | |
div#Sidebar div#Pages div.pagesnav a:link, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; emacs-rails-kit-mac - some configuration that makes carbon emacs a little nicer | |
;; Some Mac-friendly key counterparts | |
(global-set-key (kbd "M-s") 'save-buffer) | |
(global-set-key (kbd "M-z") 'undo) | |
(global-set-key (kbd "M-c") 'copy-region-as-kill) | |
(global-set-key (kbd "M-k") 'kill-region) | |
;; Mac font settings | |
(set-face-font 'default "-apple-dejavu sans mono-medium-r-normal--15-0-72-72-m-0-iso10646-1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jsCron - by Andrés Nieto | |
var jsCron = { | |
items:[], | |
interval: null, | |
parse: function(strUnix) { | |
return strUnix.match(/^(\d+|\*) (\d+|\*) (\d+|\*) (\d+|\*) (\d|\*) +(\w+)/); | |
}, | |
check: function() { | |
var hoy = new Date(); |
OlderNewer