Skip to content

Instantly share code, notes, and snippets.

@pacoguzman
pacoguzman / http_digest_authentication_test.rb
Created Mar 17, 2012
Test examples of http digest authentication that doesn't works
View http_digest_authentication_test.rb
require 'isolation/abstract_unit'
require 'rack/test'
require 'digest/md5'
require 'action_controller'
require 'rails'
module ApplicationTests
class HttpDigestAuthenticationTest < ActiveSupport::TestCase
include ActiveSupport::Testing::Isolation
include Rack::Test::Methods
@pacoguzman
pacoguzman / config.ru
Created Mar 1, 2012
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
View config.ru
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
require "rails"
@pacoguzman
pacoguzman / config.ru
Created Feb 29, 2012
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
View config.ru
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
require "rails"
# Let's load only action controller. If you want
# to use active record, just require it as well.
require "action_controller/railtie"
class MyApp < Rails::Application
@pacoguzman
pacoguzman / Gemfile
Created Nov 8, 2011
ASPGEMS RAILS BestPractices - Dalli
View Gemfile
gem 'dalli'
@pacoguzman
pacoguzman / Gemfile
Created Nov 8, 2011
ASPGEMS RAILS BestPractices - ExceptionNotification
View Gemfile
gem 'exception_notification'
@pacoguzman
pacoguzman / sphinx.yml
Created Nov 8, 2011
ASPGEMS RAILS BestPractices - ThinkingSphinx
View sphinx.yml
common: &default_settings
enable_star: true
min_infix_len: 3
charset_table: "0..9, a..z, _, A..Z->a..z, U+00C0->a, U+00C1->a,
U+00C2->a, U+00C3->a, U+00C4->a, U+00C5->a, U+00C7->c, U+00C8->e,
U+00C9->e, U+00CA->e, U+00CB->e, U+00CC->i, U+00CD->i, U+00CE->i,
U+00CF->i, U+00D1->n, U+00D2->o, U+00D3->o, U+00D4->o, U+00D5->o,
U+00D6->o, U+00D9->u, U+00DA->u, U+00DB->u, U+00DC->u, U+00DD->y,
U+00E0->a, U+00E1->a, U+00E2->a, U+00E3->a, U+00E4->a, U+00E5->a,
U+00E7->c, U+00E8->e, U+00E9->e, U+00EA->e, U+00EB->e, U+00EC->i,
@pacoguzman
pacoguzman / jquery_dialog.css
Created Nov 4, 2011
ASPGEMS JS BestPractices - Ventanas Modales
View jquery_dialog.css
.titleless .ui-dialog-titlebar { display: none }
@pacoguzman
pacoguzman / application.js
Created Nov 4, 2011
ASPGEMS JS BestPractices - RelatedSelects
View application.js
$('#candidate_form').relatedSelects({
onChangeLoad: '/candidate/profile/update_locations_select',
defaultOptionText: I18n.translate('general.choose_option'),
selects: {
'candidate_profile[country_id]' : {
loadingMessage: I18n.translate('general.loading_provinces')
},
'candidate_profile[province_id]': {
loadingMessage: I18n.translate('general.loading_locations')
},
@pacoguzman
pacoguzman / application.js
Created Nov 4, 2011
ASPGEMS JS BestPractices - Placeholders
View application.js
$(function() {
/* "Placeholder jQuery Plugin" */
$('input, textarea').placeholder();
/* "jQuery-Placeholder" */
$('input[placeholder], textarea[placeholder]').placeholder();
});
View fb_mini.css
.fan_box .full_widget {
border: solid 1px #94A3C4;
background: white;
}
.fan_box .connections_grid .grid_item {
float: left;
overflow: hidden;
padding: 0 5px 8px 0;
}