This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [] - Eqauls to | |
# ^ - Not equals to | |
# =~ - LIKE | |
# >, >=, <, <= works as expected | |
# | |
# Examples : | |
# | |
# Item.where(:colour['Red'], :quanity > 10, :price <= 200) | |
# Post.where(:comments_count >= 1, :taggings_count < 5) | |
# User.where(:country ^ 'US') # Non american users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FS = require('fs'), | |
PATH = require('path'); | |
var libs = {}; | |
// Include node's built-in modules | |
// NOTE: process.binding is a node private API, this means it may change without notice. | |
Object.keys(process.binding('natives')).forEach(function (name) { | |
libs[name] = name; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// setup.js -- add packages to require.paths | |
/// | |
/// Manage library folders and external dependency folders in your | |
/// project by including setup.js in your project. Call it from the | |
/// beginning of your project's entry-point to adjust require.paths. | |
/// | |
/// For example, if you're making an application structured like this: | |
/// | |
/// README | |
/// app.js # main program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rsolr-direct', '~> 0.1.0', :require => nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.I18n = | |
en: | |
title: "Free YouTube video download" | |
navi: | |
home: "Home" | |
howto: "Tutorial" | |
blog: "Blog" | |
termsofuse: "Terms of Use" | |
support: "Support" | |
imprint: "Imprint" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Original: http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen | |
git_bundles = [ | |
"git://github.com/vim-bundles/fuzzyfinder.git", | |
"git://github.com/scrooloose/nerdcommenter.git", | |
"git://github.com/msanders/snipmate.vim.git", | |
"git://github.com/tpope/vim-cucumber.git", | |
"git://github.com/tpope/vim-haml.git", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This library defines a new style ES objects | |
* which support delegation based mixins. A mixin | |
* chain is stored in the internal [[Mixin]] property. | |
* | |
* Used features: Harmony (ES6) proxies. | |
* | |
* Tested in FF4 beta. | |
* | |
* @author Dmitry A. Soshnikov <dmitry.soshnikov@gmail.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handles JavaScript history management and callbacks. To use, register a | |
// regexp that matches the history hash with its corresponding callback. | |
window.HashHistory = { | |
// The interval at which the window location is polled. | |
URL_CHECK_INTERVAL : 500, | |
// We need to use an iFrame to save history if we're in an old version of IE. | |
USE_IFRAME : jQuery.browser.msie && jQuery.browser.version < 8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
OlderNewer