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
# Recursively diff two hashes, showing only the differing values. | |
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license. | |
# | |
# Example: | |
# | |
# a = { | |
# "same" => "same", | |
# "diff" => "a", | |
# "only a" => "a", | |
# "nest" => { |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
diff --git a/js/jquery.raty.js b/js/jquery.raty.js | |
index cefc128..7b09b81 100755 | |
--- a/js/jquery.raty.js | |
+++ b/js/jquery.raty.js | |
@@ -140,7 +140,7 @@ | |
.live('click', function() { | |
$('input#' + containerId + '-score').val(0); | |
if (onClick) { | |
- onClick(0); | |
+ onClick.apply($this, [0]); |
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
class HelloWorldController < AbstractController::Base | |
include AbstractController::Rendering | |
include AbstractController::Layouts | |
include AbstractController::Helpers | |
include AbstractController::Translation | |
include AbstractController::AssetPaths | |
include ActionController::UrlWriter | |
# Uncomment if you want to use helpers defined in ApplicationHelper in your views | |
# helper ApplicationHelper |
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
<target name="minify"> | |
<property name="static.library.dir" value="${build.dir}/${project.web}/static/library" /> | |
<property name="yuicompressor.jar" value="/opt/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar" /> | |
<fileset dir="${project.web}/web/static/library" includes="*.js" excludes="*.min.js" id="alljs" /> | |
<fileset dir="${project.web}/web/static/library" includes="*.css" excludes="*.min.css" id="allcss" /> | |
<delete file="${build.dir}/${project.web}/static/library/all.css" /> | |
<concat destfile="${build.dir}/${project.web}/static/library/all.css" fixlastline="true"> | |
<fileset refid="allcss" /> |
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
ps ax | grep jetty | grep -v grep | awk '{system("kill -9 "$1)}' |
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
class Message < ActiveRecord::Base | |
validate :image_size_validation, :if => Proc.new { |m| m.image.present? } | |
mount_uploader :image, MessageImageUploader | |
private | |
def image_size_validation | |
errors[:image] << "should be less than 2MB" if image.size > 2.megabytes | |
end |
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
#!/bin/bash | |
# Created by Léo Hackin (leohackin at gmail.com), Jan 2011 | |
# This file is free software. You are free to use this file in any way you like | |
# However, if you change it you should note in this file that you did and who | |
# you are, you also need to change the version string if you do. That way | |
# I will not get support questions for software that is not entirely mine. | |
# rastreia_encomenda_correios v.0.1a for mac |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>feature</string> | |
</array> | |
<key>firstLineMatch</key> | |
<string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string> |
OlderNewer