This file contains hidden or 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
require 'open-uri' |
This file contains hidden or 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
<form id="imagesearch" action="/modelname/imagesearch" method="post" > | |
Search for an image | |
<input type="text" name="query" class="floatleft" /> | |
<input type="submit" name="submit" value="submit"/> | |
</form> | |
<center> | |
<div id="imageresults"></div> | |
</center> |
This file contains hidden or 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
searchd --pidfile --config config/development.sphinx.conf |
This file contains hidden or 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/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Mongodb startup script | |
# Description: Mongodb start stop daemon sends SIGINT to terminate | |
# say man signal to see details | |
# Please check the startup params and replication options |
This file contains hidden or 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
var express = require('express'); | |
var app = express.createServer(); | |
require('./settings').boot(app); | |
app.dynamicHelpers({ | |
base: function(){ | |
// return the app's mount-point | |
// so that urls can adjust. For example | |
// if you run this example /post/add works |
This file contains hidden or 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
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/db_name'); | |
// map function | |
var map = function(){ | |
emit(this.field_to_group_by, { | |
other_fields: this.other_fields | |
// list other fields like above to select them | |
}) | |
} |
This file contains hidden or 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
# /Capfile | |
# you need to install capistrano gem | |
# gem install capistrano | |
# gem install capistrano-ext | |
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
load 'config/deploy' |
This file contains hidden or 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
Started POST "/" for 59.97.201.56 at 2011-08-06 06:21:02 -0700 | |
2011-08-06T13:21:02+00:00 app[web.1]: | |
2011-08-06T13:21:02+00:00 app[web.1]: EOFError (bad content body): | |
2011-08-06T13:21:02+00:00 app[web.1]: | |
2011-08-06T13:21:02+00:00 app[web.1]: | |
2011-08-06T13:21:02+00:00 app[web.1]: | |
2011-08-06T13:21:02+00:00 app[web.1]: Rendered .bundle/gems/ruby/1.9.1/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (22.9ms) | |
2011-08-06T13:21:02+00:00 app[web.1]: Error during failsafe response: ActionView::Template::Error | |
2011-08-06T13:21:02+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/utils.rb:495:in `parse_multipart' | |
2011-08-06T13:21:02+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/request.rb:270:in `parse_multipart' |
This file contains hidden or 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
# git clone https://github.com/kcrawford/rest-client.git | |
require "rubygems" | |
require './rest-client/lib/rest_client' | |
RestClient.post 'http://localhost:9292/', :foo => File.new("public/images/rails.png"), :multipart => true | |
# RestClient.post 'http://aesthete-api-rack.heroku.com/', :foo => File.new("public/images/rails.png"), :multipart => true | |
# RestClient.post 'http://posttestserver.com/post.php', :foo => File.new("public/images/rails.png"), :multipart => true | |
# RestClient.post 'http://aesthete-api.heroku.com/', :foo => File.new("public/images/rails.png"), :multipart => true |
This file contains hidden or 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
if you get this error | |
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError /tmp/stream20110811-30041-x7rvaq-0.jpg is not recognized by the 'identify' command. | |
try | |
$identify whatever_file_name.jpg | |
if you get something like this | |
identify: no decode delegate for this image format `madhusudhanms.jpg' @ error/constitute.c/ReadImage/532. |