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
# i18n | |
en: | |
activerecord: | |
models: | |
topic: Topic | |
attributes: | |
topic: | |
posts_body: Body | |
# topic |
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
# validation method 1 | |
if @user.save && @order.save && @city.save | |
... | |
else | |
... | |
end | |
# validation method 2 |
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
xml.feed(:xmlns => "http://www.w3.org/2005/Atom") { |feed| | |
feed.title("#{user.name}'s Private Notification Feed") | |
feed.link(:href => "http://#{account.subdomain}.domain.com/feeds/#{user.email_alias}.xml", :rel => "self") | |
feed.link(:href => "http://#{account.subdomain}.domain.com") | |
} |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'mechanize' | |
require 'cgi' | |
a = Mechanize.new { |agent| | |
agent.user_agent_alias = 'Mac Safari' | |
} |
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
" insert into the .vimrc file. | |
augroup CommandTExtension | |
autocmd! | |
autocmd FocusGained * CommandTFlush | |
autocmd BufWritePost * CommandTFlush | |
augroup 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
# modify the CallStack="true", <customErrors mode="Off" /> and <compilation debug="true"> in web.config file. | |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<configuration> | |
... | |
<SharePoint> | |
<SafeMode MaxControls="200" | |
CallStack="true" | |
DirectFileDependencies="10" | |
TotalFileDependencies="50" |
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
Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths| | |
load_paths << "#{Rails.root}/app/assets/stylesheets/lib" | |
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
#!/usr/bin/env ruby | |
ENV['RAILS_ENV'] ||= 'development' | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'daemon_spawn' | |
class ResqueWorkerDaemon < DaemonSpawn::Base | |
def start(args) | |
@worker = Resque::Worker.new('*') # Specify which queues this worker will process |
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 'bundler/capistrano' | |
load 'deploy/assets' | |
set :domain, "example.com" | |
set :application, "application" | |
set :user, "deploy" | |
set :password, "secret" | |
set :use_sudo, false | |
set :deploy_to, "/home/#{user}/www/#{application}" | |
set :shared_path, "#{deploy_to}/shared" |
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
*filter | |
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 | |
-A INPUT -i lo -j ACCEPT | |
# Accepts all established inbound connections | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allows all outbound traffic | |
# You could modify this to only allow certain traffic | |
-A OUTPUT -j ACCEPT | |
# Allows HTTP and MySQLconnections from anywhere (the normal ports for websites) | |
-A INPUT -p tcp --dport 80 -j ACCEPT |
OlderNewer