Skip to content

Instantly share code, notes, and snippets.

class Test
def self.test
hash = {:entry => ""}
array = []
array << self.test2(hash)
array << self.test2(hash)
array << self.test2(hash)
array << self.test2(hash)
array << self.test2(hash)
array
== Before
Event checking for duplicates
- should not be flagged as a possible duplicate if there's an event with same date but different title
- should not be flagged as a possible duplicate if there's an event with same title but different date
- should be flagged as a possible duplicate if there is an event with same date and similar title
- should ignore case
- should be done on save
- should not use itself as a duplicate
== Now
Hello,
Thanks for the email and nice to read from you,i can assure you of the viewing but i will like to discuss some thing with you, as you know am in Ireland currently and before i can come down for the viewing i will like to see a proof of your financial capacity and to know how serious you are in need of the property because i have been fooled so many times and i will not let that to happen to me again, Been fooled by several tenant telling me to come from Ireland to London to show them my property but when i got there for the viewing they will never show up and when i called there phone they will keep on banging the phone on me so it has been a very sad and disappointing occasion for me and i waste alot of money also for transport when coming for the viewing, so i don't want that to happen to me anymore,well this is what you will have to do for me before i can come down for the viewing, If you have a partner or friend in UK,what you will have to do is to locate a western union money transfer around you
#!/usr/bin/ruby
# Download NASA MODIS imagery and use it as a desktop background.
# You'll need ImageMagick installed for this to work.
require 'date'
require 'net/http'
# Screen width/height
X = 1440
Y = 900

Deploying Rails

Passenger

We are using [Passenger][1] to serve Rails application requests, which integrates into Apache (it's also known as mod_rails). This means there is not much configuration to keep Rails running.

Rails environments

Rails internally handles a lot of the different environments. To set which environment Rails is running in, simply set the RailsEnv configuration in the apache vhost config file, which for this app is located at /etc/httpd/sites-available/application_name. We currently have 4 environments, of which only the last two will be relevant for you - development, test, staging and production.

Consider this:
`= select_tag "blockstyles[#{blockstyle}]"`
Now consider
`blockstyle == "[Basic Text Frame]"`
resulting in http parameter name
@james
james / hipster.rb
Created March 7, 2011 11:10
10 minutes of filthy code to let me know if I'm allowed to like the tune I'm listening
require 'rubygems'
require 'json'
require 'net/http'
require 'cgi'
def track_info(title, artist)
JSON.parse(http.get("/2.0/?method=track.getinfo&api_key=b25b959554ed76058ac220b7b2e0a026&artist=#{CGI.escape(artist)}&track=#{CGI.escape(title)}&format=json").body)
end
def http
@james
james / gist:1231642
Created September 21, 2011 09:16
attr_accessor parsed as a method variable when setting with a get
class Base
attr_accessor :configuration
def initialize(configuration)
@configuration = configuration
end
def do_a_thing
configuration = configuration + 1
end
ethan:breakcore james$ ruby scrape.rb
"starting download of firestorm viper - \"cut dem down\""
"Failed 404 Not Found"
"starting download of firestorm viper - \"haters want war\""
"Failed 404 Not Found"
"starting download of firestorm viper - \"live in paris\""
"Failed 404 Not Found"
"starting download of firestorm viper - \"live in vancouver\""
"Failed 404 Not Found"
"starting download of kid606 - \"live at ultrahang fest, 09.25.03\""
I don't understand that if this is, and always has been a partisan account,
then why Boris received a formal letter of warning from the GLA when using
it to post partisan updates
(http://www.guardian.co.uk/politics/2009/dec/08/boris-johnson-twitter-party-political).
Surely you can agree that the account, if not illegal, has been misleading
enough for thousands of londoners and the GLA itself to confuse it as an
official public information source?