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
let Immutable = require('immutable'), | |
devTools = require('redux-devtools').devTools; | |
let { createStore, applyMiddleware, compose } = require('redux'); | |
let state = Immutable.fromJS({ | |
one: { number: 1 } | |
}); | |
function reducer(state, action) { | |
if(action.type === 'ONE') { |
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
upstream unicorn_myapp { | |
server unix:/data/myapp/shared/sockets/unicorn.sock fail_timeout=0; | |
} | |
server | |
listen 80; | |
client_max_body_size 4G; | |
server_name _; | |
keepalive_timeout 5; |
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
Bluepill.application("<%= app %>", :foreground => false, :log_file => "/data/<%= app %>/shared/log/bluepill.log") do |app| | |
app.uid = "<%= user %>" | |
app.gid = "<%= user %>" | |
app.working_dir = "/data/<%= app %>/current/" | |
<% if engine.process_names.include? 'unicorn' %> | |
<% process = engine.process('unicorn') %> | |
<% port = engine.port_for(process, 1) %> | |
app.process('unicorn') do |process| | |
process.pid_file = "/data/<%= app %>/shared/pids/unicorn.pid" |
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"?> | |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<soap:Body> | |
<GetPerformanceDetailWithDiscountingSYOSExResponse xmlns="http://tessiturasoftware.com/"> | |
<GetPerformanceDetailWithDiscountingSYOSExResult> | |
<Id>1</Id> | |
<Title>The Kitchen</Title> | |
<PerformanceDate><%= @date %></PerformanceDate> | |
<ZoneMap>259</ZoneMap> |
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
// In controller: | |
MyApp.MyController = SC.Object.create({ | |
items: [], | |
total: function(){ | |
// calculate the total value of items | |
}.property('items.[]') | |
}) |
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
// subclass ContainerView which has an array observer on childViews | |
MyApp.MyContainerView = SC.ContainerView.extend({ | |
}) | |
// Then in controller, or state chart maybe: | |
var newView = SC.TextField.create() | |
containerViewInstance.get('childViews').pushObject(newView); | |
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
<% | |
1.upto(100) do |i| | |
%> | |
user_<%= i %>: | |
email: <%= Faker::Internet.email %> | |
<% if User.columns.map(&:name).include?("crypted_password") %> | |
crypted_password: "c9ef770ede786cdb33e02c3432c16151bc727ce3c73ffcff7395eeba82da5fe01383cb30050bfc55ffd3d92afe3c1a400eb0a27c8cc372d5aa7e00e55262e9fd" | |
salt: "XBzzaBi04ZEQxIPz9VH" | |
<% end %> | |
<% 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
?> a = Order.find(43).adjustments.first | |
=> #<Adjustment id: 7, order_id: 43, amount: #<BigDecimal:104cdf208,'0.25E1',8(8)>, label: "Shipping", created_at: "2010-09-02 19:23:06", updated_at: "2010-09-02 21:39:12", source_id: 11, source_type: "Shipment", mandatory: nil, frozen: nil, originator_id: 1, originator_type: "ShippingMethod"> | |
?> a.originator_id | |
=> 1 | |
>> a.originator_id = 3 | |
=> 3 | |
>> a.save! | |
=> true | |
>> a.reload |
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
context "#remove_item" do | |
before do | |
real_order = Order.create | |
Fabricate(:line_item, :order => real_order) | |
controller.stub(:current_order).and_return(real_order) | |
end | |
it "should remove an existing line item from the order" do | |
delete :remove_item, :id => real_order.line_items.first.id | |
real_order.line_items.count.should == 0 | |
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
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| | |
Rails.env == "production" ? require(c) : load(c) | |
end |
NewerOlder