Skip to content

Instantly share code, notes, and snippets.

View scottillogical's full-sized avatar

Scott Schulthess scottillogical

  • Zipcar
  • Boston, MA
View GitHub Profile
#
# Granddaddy test. Save all the different types of entry then run the service call to see if it returns the correct data
#
it "should return correct redirect_urls with everything in the database" do
debugger
h = {:tid => "990"}
# just tid
google = "http://www.google.com"
UnapprovedCreativeFactory.new(h.merge({:redirect_url => google})).arrive.should be_eql google
# application.html.erb
<%=raw yield_section(1, :description) %>
# application_helper.rb
def yield_section(number, content_name)
content = find_dynamic_content(number)
return content if content
yield content_name # throws a no block given (yield) error, it's supposed to yield to the view
end
"local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
describe SourcesController do
describe "in the cacher" do
let (:cm2_source) {Factory(:sem_source)}
let (:source) { cm2_source.recache}
subject {source.cm2_sem_source_id}
it {should_not be_nil}
it {should eql cm2_source.id}
it {should_not eql cm2_source.source_code}
end
On the same topic is we are pushing further into HTTP caching so we've always had features that enables HTTP caching but a lot of people haven't used them. In part because the only user of the HTTP caching was individual clients, web browsers and that doesn't help if you have a thousand users, each one of them is still going to knock in a lot of HTTP caching so people have used other techniques like fragment caching or page caching instead. And what we are doing with Rails 3.1 is shipping with rack-cache which is a caching layer that' built in.
That will enable you to use HTTP caching more intelligently and have it be equivalent to sort of page caching, action caching, or fragment caching in some cases it means thinking about your application a little bit differently but it also means that we will enable using HTTP caching which should work with other caching servers like SQUID or Akamai without having to sort of rewrite your caching layer, so if you go buy Akamai you have already built your application to

On the same topic is we are pushing further into HTTP caching so we’ve always had features that enables HTTP caching but a lot of people haven’t used them. In part because the only user of the HTTP caching was individual clients, web browsers and that doesn’t help if you have a thousand users, each one of them is still going to knock in a lot of HTTP caching so people have used other techniques like fragment caching or page caching instead. And what we are doing with Rails 3.1 is shipping with rack-cache which is a caching layer that’ built in.

That will enable you to use HTTP caching more intelligently and have it be equivalent to sort of page caching, action caching, or fragment caching in some cases it means thinking about your application a little bit differently but it also means that we will enable using HTTP caching which should work with other caching servers like SQUID or Akamai without having to sort of rewrite your caching layer, so if you go buy Akamai you have already built your application to

# Use back-tick (`) as the control key:
set-option -g prefix `
unbind-key C-b
bind-key ` send-prefix
[
-
{
-
template: {
name: "left_content"
-
slots: [
-
irb(main):001:0> [:hi, :what]
=> [:hi, :what]
irb(main):002:0> a = [:hi, :what]
=> [:hi, :what]
irb(main):003:0> a[0]
=> :hi
irb(main):004:0> a[2]
=> nil
irb(main):005:0> a[1]
=> :what
" leader stuff
let mapleader = ","
noremap <leader>l <C-^>
map <leader>b :FufBuffer<CR>
map <leader>f :NERDTreeFind <CR>
nnoremap <leader>a :Ack --ignore-dir=vendor/ruby --ignore-dir=vendor/bundle --ignore-dir=vendor/cache --ignore-dir=log --ruby