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
Location: /var/www/test_app | |
Unicorn: unicorn -c /var/www/test_app/config/unicorn.rb -D | |
Unicorn: bundle exec unicorn_rails -c config/unicorn.rb -E development | |
nginx config: /opt/local/etc/nginx/nginx.conf || /etc/nginx/nginx.conf | |
whenever --set environment=development | |
whenever --update-crontab |
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
[TestMethod] | |
public void MergeCustomers() | |
{ | |
using (TransactionScope scope = new TransactionScope()) | |
{ | |
var context = new AdminModelEntities(); | |
var service = new CustomersService(context); | |
var newCustomerId = service.MergeCustomers(new List<int> { 523184, 530696 }); |
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
// My first attempt | |
var appointments = _context.T_APPOINTMENT.Where(c => ids.Contains(c.CUSTOMER_ID)); | |
foreach (var appointment in appointments) | |
{ | |
appointment.CUSTOMER_ID = newCustomer.CUSTOMER_ID; | |
_context.T_APPOINTMENT.ApplyCurrentValues(appointment); | |
} | |
_context.SaveChanges(); |
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
#Commands | |
rails g rspec:install | |
guard init rspec | |
spork --bootstrap | |
#Related Files | |
Guardfile: https://gist.github.com/4369789 | |
spec_helper.rb: https://gist.github.com/4369786 | |
#Related links |
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
require 'rubygems' | |
require 'spork' | |
#uncomment the following line to use spork with the debugger | |
#require 'spork/ext/ruby-debug' | |
Spork.prefork do | |
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' |
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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch('config/environments/test.rb') | |
watch(%r{^config/initializers/.+\.rb$}) | |
watch('Gemfile') | |
watch('Gemfile.lock') |
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
def self.get_events_count token | |
notified_user = ApiKey.find_by_push_token(token).user | |
notifications_count = 0 | |
# Getting events from active games | |
active_games = Match.find(:all, :conditions => [ "challenger_id = ? or opponent_id = ? and is_over = false or is_over is null", notified_user.id, notified_user.id ]) | |
active_games.each do |game| | |
is_challenger = game.challenger_id == notified_user.id | |
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
<div class="container" style="width:400px"> | |
<div class="row-fluid"> | |
<div class="span3"><a href="https://twitter.com/share?via=vacantesrd&text=Conoce a http://www.emplea.do, un job board dedicado al sector de tecnología de la información en la República Dominicana. " class="twitter-share-button" data-lang="en">Tweet</a></div> | |
<div class="span3"><div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div></div> | |
<div class="span3"><g:plusone></g:plusone></div> | |
<div class="span3"><script type="IN/Share" data-counter="right"></script></div> | |
</div> | |
</div> |
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 CompaniesController < ApplicationController | |
include ActionController::MimeResponds | |
respond_to :json, :xml |
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
def index | |
@companies = Company.all | |
respond_with @companies | |
end |
OlderNewer