Skip to content

Instantly share code, notes, and snippets.

@avinasha
avinasha / Gemfile
Created July 18, 2012 10:08
Platform dependent gems
group :production, :test, :cucumber, :staging do
gem 'rb-inotify', :require => false
end
group :test, :development, :cucumber do
gem 'rb-fsevent', :require => false
end
@avinasha
avinasha / supportbee_form.html
Created December 5, 2011 20:39
Embed SupportBee Form
Add the following code block with the correct options to embed SupportBee in any website
<script src="https://sbassets.s3.amazonaws.com/widget/script.js" type="text/javascript"></script>
<script>
var sb_form = SupportBee.Form.initialize({
company: 'techfolder',
height: '400px',
base_domain: 'supportbee.com',
position: 'bottom'
});
class CucumberExternalResqueWorker
DEFAULT_STARTUP_TIMEOUT = 1.minute
COUNTER_KEY = "cucumber:counter"
class << self
attr_accessor :pid, :startup_timeout
def start
# Call from a Cucumber support file so it is run on startup
return unless Rails.env.cucumber?
@avinasha
avinasha / about.md
Created August 16, 2011 07:31 — forked from catwell/about.md
Programming Achievements: How to Level Up as a Developer
@avinasha
avinasha / about.md
Created August 16, 2011 07:20 — forked from blaix/about.md
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of the gist from this blog post.

@avinasha
avinasha / css_transformer.rb
Created July 29, 2011 06:40
A Sanitize gem transformer which sanitizes any CSS in a HTML document.
check_css = lambda { |env|
node = env[:node]
node_name = env[:node_name]
# Don't continue if this node is already whitelisted or is not an element.
return if env[:is_whitelisted] || !node.element?
parent = node.parent
return unless node_name == 'style' || node['style']
if node_name == 'style'
unless good_css? node.content
node.unlink