This file contains hidden or 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
| (function() { | |
| $.fn.extend({ | |
| switchClass: function(from, to) { | |
| this.removeClass(from).addClass(to); | |
| } | |
| }); | |
| })(jQuery); |
This file contains hidden or 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
| [ | |
| :ignore_accept_header, | |
| :ignore_accept_header=, | |
| :auth_type, | |
| :gateway_interface, | |
| :path_translated, | |
| :remote_host, | |
| :remote_ident, | |
| :remote_user, | |
| :remote_addr, |
This file contains hidden or 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
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> |
This file contains hidden or 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
| (function($) { | |
| var elements, | |
| bind = { | |
| buttonClick: function() { | |
| elements.$button.click(e) { e.preventDefault(); | |
| action.sayHello('World'); | |
| } | |
| } | |
| }, |
This file contains hidden or 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 Users::SessionsController < Devise::SessionsController | |
| # POST /users/sign_in | |
| def create | |
| resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new") | |
| set_flash_message(:notice, :signed_in) if is_navigational_format? | |
| sign_in(resource_name, resource) | |
| respond_with resource, :location => "http://#{request.host_with_port}#{redirect_location(resource_name, resource)}" | |
| end | |
| end |
This file contains hidden or 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
| group :production do | |
| gem 'rack-ssl-enforcer', :require => 'rack/ssl-enforcer' | |
| end |
This file contains hidden or 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
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'nkf' | |
| def get_title(url) | |
| url.gsub!(Regexp.new("[^#{URI::PATTERN::ALNUM}\/\:\?\=&~,\.\(\)#]")) {|match| ERB::Util.url_encode(match)} | |
| read_data = NKF.nkf("--utf8", open(url).read) | |
| Nokogiri::HTML.parse(read_data, nil, 'utf8').xpath('//title').text | |
| end |
This file contains hidden or 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
| require "rubygems" | |
| require "sinatra/base" | |
| require "erb" | |
| class MyApp < Sinatra::Base | |
| helpers do | |
| def qunit(test_js, fixtures = nil) | |
| result = '<link rel="stylesheet" href="/qunit/qunit.css" type="text/css" media="screen" /><script type="text/javascript" src="/qunit/qunit.js"></script>' | |
| case test_js.class.name | |
| when 'Array' |
This file contains hidden or 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
| (function($) { | |
| $.extend({ | |
| log: function(arg) { | |
| if (typeof console === 'undefined') { | |
| var ID = 'jquery-console-view', | |
| $console_view = $('#' + ID), | |
| $log = $('<p></p>').text(arg); | |
| if ($console_view.size() <= 0) { | |
| $console_view = $('<div></div>').attr({id: ID}).appendTo('body'); | |
| } |
This file contains hidden or 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
| $.extend({ | |
| len: function(arg) { | |
| var result = 0; | |
| if (typeof arg === 'object' && !$.isArray(arg)) { | |
| for (var i in arg) result++; | |
| } else { | |
| if (typeof arg === 'number') arg = arg.toString(); | |
| result = arg.length; | |
| } | |
| return result; |
OlderNewer