Skip to content

Instantly share code, notes, and snippets.

class Notification < ActiveRecord::Base
belongs_to :sender, class_name: "User"
belongs_to :receiver, class_name: "User"
validates :sender_id, presence: true
validates :receiver_id, presence: true
attr_accessible :sender_id, :receiver_id
end
development:
adapter: postgresql
encoding: unicode
database: app_development
pool: 25
username: notmyrealusername
password: notmyrealpassword
[therrell@uw1-320-16 ftp]$ ./ftp ftp.tripod.com
220 Welcome to Tripod FTP.
Name (ftp.tripod.com:therrell): css432
331 Username set to css432. Now enter your password.
Password:
230- IMPORTANT NOTICE
230- ============================================================
230-
230- Powerful building tools. Traffic-generating, money-making
230- programs. It's all waiting for you at Tripod.
@john-bai
john-bai / elasticsearch_geo_distance_example
Created June 28, 2011 02:11
Working example on how to use geo_distance filter on Elastic Search
# Manually create the index
curl -XPUT 'http://localhost:9200/pins/'
# Create proper mapping
curl -XPUT 'http://localhost:9200/pins/pin/_mapping' -d '
{
"pin" : {
"properties" : {
"location" : {
"type" : "geo_point"
@john-bai
john-bai / geo_distance error
Created June 28, 2011 00:41
Error when performing geo_distance filter example
jtherrell$ curl -XGET http://localhost:9200/test/pin/_search?pretty=true -d '{
"query" : {
"match_all" : {}
}
}
'
{
"took" : 2,
"timed_out" : false,
"_shards" : {