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
(Using Fedora Core 9) | |
http://wiki.rubyonrails.org/database-support/ms-sql | |
sudo yum install unixODBC.x86_64 unixODBC-devel.x86_64 | |
sudo yum install freetds.x86_64 freetds-devel.x86_64 | |
sudo gem install dbd-odbc | |
sudo gem install dbi | |
sudo gem install activerecord-sqlserver-adapter --source=http://gems.rubyonrails.org |
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
module NumberPercentageExtension | |
module InstanceMethods | |
# the idea converting english to numbers taken from http://www.ruby-forum.com/topic/132735#591799 | |
ENGLISH_VALUE = {} | |
%w| zero one two three four five six seven eight nine ten eleven | |
twelve thirteen fourteen fifteen sixteen seventeen eighteen | |
nineteen |.each_with_index{ |word,i| ENGLISH_VALUE[word] = i } | |
%w| zero ten twenty thirty forty fifty sixty seventy eighty | |
ninety|.each_with_index{ |word,i| ENGLISH_VALUE[word] = i*10 } |
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
=== Cron | |
Here's how to create a crontab that runs a rake task every 15 minutes, as the user webapp: | |
<tt> | |
sudo crontab -u webapp -e | |
</tt> | |
Vim pops up. Add a line to the file as follows: |
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
# PostgreSQL Notes | |
For first time Postgres users, the tutorial section on the documentation is a must read: http://www.postgresql.org/docs/8.4/interactive/tutorial.html | |
### Installation | |
Easiest way is to use your package manager (yum, apt-get, etc). On MacOS, macports made it easy. Building the source is straightforward as well. There are plenty of resources online... | |
### Get acquainted with psql |
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
create table count_cache ( | |
id serial primary key, | |
table_name varchar(255) not null, | |
count int not null | |
) | |
create table people ( | |
id serial primary key, | |
name varchar(255) not null | |
) |
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
include 'singleton' | |
class Configuration | |
include Singleton | |
def self.run | |
yield Configuration.instance | |
post_config_process | |
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
# ------------------------------------------- | |
# Simple PostgreSQL Configuration File v. 8.4 | |
# ------------------------------------------- | |
# This file provides a simple configuration with the most common options | |
# which most users need to modify for running PostgreSQL in production, | |
# including extensive notes on how to set each of these. If your configuration | |
# needs are more specific, then use the standard postgresql.conf, or add | |
# additional configuration options to the bottom of this file. | |
# |
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
ree-1.8.7-2010.02 > some_string = "hi there" | |
=> "hi there" | |
ree-1.8.7-2010.02 > some_string.capitalize | |
=> "Hi there" | |
ree-1.8.7-2010.02 > some_method = some_string.method :capitalize | |
=> #<Method: String#capitalize> | |
ree-1.8.7-2010.02 > some_method.call | |
=> "Hi there" | |
ree-1.8.7-2010.02 > String.class_eval { remove_method(:capitalize) } | |
=> String |
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
# hoptoad_notifier generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator | |
abstract -v1.0.0 | |
actionmailer -v3.0.3 | |
actionmailer -v3.0.2 | |
actionmailer -v3.0.1 | |
actionmailer -v3.0.0 | |
actionmailer -v2.3.8 | |
actionpack -v3.0.3 | |
actionpack -v3.0.2 | |
actionpack -v3.0.1 |
OlderNewer