Skip to content

Instantly share code, notes, and snippets.

View mdepolli's full-sized avatar

Marcelo De Polli mdepolli

  • Shore GmbH
  • Munich, Germany
View GitHub Profile
@mattconnolly
mattconnolly / gist:4158961
Created November 28, 2012 04:04
RSpec basic authentication helper module for request and controller specs
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
@Frobitz
Frobitz / coffeescript-homebrew
Created August 4, 2012 13:32
Install CoffeeScript with Homebrew on OS X 10.8 Mountain Lion
# Install Homebrew
ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
# Follow on-screen instructions (X11 isn't necessary for this if it shows as not installed)
brew install node
# Open .bashrc and add this line (create .bashrc if its not in your home directory already)
@Tarrasch
Tarrasch / README.md
Last active September 12, 2016 18:14
Unity plus xmonad configuration (Ubuntu 12.04)

What

This is my xmonad+unity panel config. With this config, you'll have a well integrated panel from unity but still have xmonad as your window manager with your gnome apps, including the pretty gnome-terminal (for those too lazy to learn xmoobar).

This config doesn't have the unity launcher, mainly becuse it causes windows to be unfloatable, besides I'm not fond of it anymore.

How

Copy and paste these lines (or understand what it does and do it manually).

@runemadsen
runemadsen / description.markdown
Created September 26, 2011 15:23
Reverse polymorphic associations in Rails

Polymorphic Associations reversed

It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media

This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.

@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')