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
drop schema if exists jaytest cascade; | |
create schema jaytest; | |
set search_path to jaytest; | |
create table questions ( | |
id int not null primary key, | |
user_id int not null | |
); | |
insert into questions |
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
Reference number: LTK41902794173X Please use this ticket number in any correspondence with Newegg.com. | |
Subject: RMA #20851593 shipping | |
Dear Customer, | |
Thank you for contacting Newegg. | |
I am sorry for this inconvenience. I have waived the restocking fee on the RMA # 20851593. However, we do not return the original shipping cost for customers. However, I have sent $52.41 credit back to your source of payment as a one time exception to cover the original shipping cost. | |
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
#!/usr/bin/env ruby | |
puts "true" and return if true | |
puts "fell through" | |
abort |
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 Pet < ActiveRecord::Base | |
has_many :user_pets | |
belongs_to :user, :through => :user_pets | |
validates :name, :allow_nil => true, :inclusion => { :in => Pet.valid_pets } | |
def self.valid_pets | |
['fish', | |
'bird', | |
'tree', |
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
CREATE TABLE posts | |
( | |
id int primary key, | |
position int, | |
animal text | |
); | |
INSERT INTO posts | |
(id, position, animal) | |
VALUES |
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
mc$prepare_cache_copy: procedure (compname, slot, code); | |
declare compname char(32)var; | |
declare slot bin(15); | |
declare code bin(15); | |
if (^ mc$manager_lock_slot (compname, LOCK$EXCLUSIVE)) then | |
return; | |
mc$current_slot.flags.requested = TRUE; | |
slot = mc$current_slot_n; |
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
SELECT tappables.id, max( | |
case | |
when tappables.type = 'SurveyReceipt' | |
then tappables.created_at | |
when taps.user_id = 2816 | |
then taps.created_at | |
else | |
taps.skewed_created_at | |
end) as last_tap | |
FROM tappables |
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
UPDATE tappables SET taps_count = count(taps.id) | |
FROM taps | |
WHERE taps.tappable_id = tappables.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
# This file is used by Rack-based servers to start the application. | |
# Manually include newrelic first so it gets its route | |
require 'newrelic_rpm' | |
require 'new_relic/rack/developer_mode' | |
use NewRelic::Rack::DeveloperMode | |
require ::File.expand_path('../config/environment', __FILE__) | |
run Mindset::Application |
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
SELECT tappables.id, | |
max(case | |
when tappables.type = 'Survey' | |
then case | |
when (not exists survey_responses) -- pseudo-code | |
then now() - random() * interval '1 day' | |
else | |
max(survey_responses.created_at) | |
end | |
when taps.user_id = :user_id |
NewerOlder