Skip to content

Instantly share code, notes, and snippets.

View endeepak's full-sized avatar

Deepak Narayana Rao endeepak

View GitHub Profile
@endeepak
endeepak / xvfb
Last active August 29, 2015 14:10 — forked from iafonov/gist:1113433
#!/bin/sh
unset DISPLAY
if [ ! -f /tmp/.X99-lock ]; then
Xvfb :99 -ac &
fi
export DISPLAY=:99
bundle install --path ../bundle --quiet --without development production &&
@endeepak
endeepak / README.markdown
Created April 11, 2012 21:06 — forked from beccasaurus/README.markdown
Without this, returning a 400 gives you just "Bad Request" ... with this, you can return a custom response

If you don't have the XML snippet below in your Web.config and your .NET app tries to return a 400 with custom data, you get this:

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET

Date: Tue, 19 Apr 2011 17:47:46 GMT

@endeepak
endeepak / sass_and_less_compared.markdown
Created February 23, 2011 18:11 — forked from chriseppstein/sass_and_less_compared.markdown
sass_and_less_compared markdown

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For less, I'm using the ruby version because this is what they suggest on the website. The javascript version may be different.

Variables

@endeepak
endeepak / spec_examples.rb
Created February 12, 2011 09:01 — forked from hosh/spec_examples.rb
rspec-best-practices-and-tips
#http://eggsonbread.com/2010/03/28/my-rspec-best-practices-and-tips/
describe User do
subject { user }
let(:user) { User.new }
context "when name empty" do
it { should_not be_valid }
specify { user.save.should be_false }
end
@endeepak
endeepak / ruby-1.9-tips.rb
Created February 5, 2011 19:43 — forked from igrigorik/ruby-1.9-tips.rb
Ruby 1.9 Tips, Tricks & Features
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@endeepak
endeepak / example.feature
Created December 21, 2010 17:15 — forked from matschaffer/example.feature
cucumber javascript alert confirm
@javascript
Scenario: confiming when saving inactive
Given I expect to click "OK" on a confirmation box saying "Are you sure?"
When I press "Save"
Then the confirmation box should have been displayed
And I should see "TV" in the "Campaign Keywords" section