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
module MultiTenantedCacheKeys | |
def cache_key | |
tenant_database_name + "/" + super | |
end | |
def tenant_database_name | |
Apartment::Database.current_database | |
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
<h1>hypothesis: first gen ipad is slow when typing in content editables</h1> | |
<label>textarea. should be snappy.</label> | |
<textarea rows=5 cols=70></textarea> | |
<label>content editable. should be laggy</label> | |
<div style="height: 50px; border: 1px solid #000;" contenteditable></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
if clumsy | |
staff_members = StaffMember.alphabetical | |
@reports = staff_members.map {|s| [ s, TransactionReport.where(:staff_member_id => s.id).where(:created_at => @date_range) ]} | |
end # 3000ms | |
if smart | |
report = TransactionReport.where(:created_at => @date_range) | |
@reports = report.group_by(&:staff_member).sort_by{|g| [g.first.last_name, g.first.first_name] } | |
end # 8000ms |
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
app = require('express')(); | |
... | |
app.use(function(req, res, next) { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET, OPTIONS'); | |
res.header('Access-Control-Allow-Headers', 'Content-Type'); | |
return next(); | |
}); |
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
<settlement> | |
<pmt1> # Debitware goes first | |
<devicetype>16</devicetype> # specifies Debitware | |
<swipe_no>1233</swipe_no> # it's not documented which Debitware fields are required/used | |
..... # Other Debitware Fields ?????? | |
<amount>100.00</amount> # The amount specified by the guest they would like to pay with their gift card | |
<tax>12.00</tax> # should this be the proportion of tax paid by the debitware amount? | |
</pmt1> | |
<pmt2> | |
<devicetype>15</devicetype> # is this still optional in this case? |
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
if (0) { "good job" } | |
>> undefined | |
if (1) { "good job" } | |
>> "good job" |