Skip to content

Instantly share code, notes, and snippets.

https://en.wikipedia.org/wiki/List_of_kings_of_Sparta
http://sparta-dion.herokuapp.com/
irb(main):003:0> reload!; puts MerchantDirectory::Activity.fully_provisionable.count
Reloading...
Creating scope :published. Overwriting existing method MerchantDirectory::Activity.published.
Creating scope :published. Overwriting existing method MerchantDirectory::Profile.published.
(143.1ms) SELECT DISTINCT COUNT(DISTINCT `merchant_directory_activities`.`id`) FROM `merchant_directory_activities` INNER JOIN merchant_directory_variants ON merchant_directory_variants.merchant_activity_id = merchant_directory_activities.id INNER JOIN merchant_directory_availability_rules ON merchant_directory_availability_rules.merchant_variant_id = merchant_directory_variants.id WHERE (merchant_directory_activities.confero_id IS NOT NULL) AND (merchant_directory_variants.advance_product_id is null) AND (merchant_directory_variants.price IS NOT NULL) AND (merchant_directory_variants.duration < 86400) AND (merchant_directory_availability_rules.start_date is not NULL) AND (merchant_directory_availability_rules.end_date is not
@alkema
alkema / queries.rb
Last active December 15, 2015 03:21
irb(main):004:0> reload!; puts MerchantDirectory::Activity.fully_provisionable.count
Reloading...
(265.5ms) SELECT DISTINCT COUNT(DISTINCT `merchant_directory_activities`.`id`) FROM `merchant_directory_activities` INNER JOIN merchant_directory_variants ON merchant_directory_variants.merchant_activity_id = merchant_directory_activities.id INNER JOIN merchant_directory_availability_rules ON merchant_directory_availability_rules.merchant_variant_id = merchant_directory_variants.id WHERE (merchant_directory_activities.confero_id IS NOT NULL) AND (merchant_directory_variants.price IS NOT NULL) AND (merchant_directory_variants.duration < 86400) AND (merchant_directory_availability_rules.start_date is not NULL) AND (merchant_directory_availability_rules.end_date is not NULL) AND (merchant_directory_availability_rules.valid_days != '[]') AND (merchant_directory_availability_rules.start_time is not null)
9655
irb(main):005:0> MerchantDirectory::Variant.where('merchant_directory_variants.duration > 86400').update_
[2015-11-29 02:46:27 +0000] Starting
[2015-11-29 02:46:28 +0000] Error!
[2015-11-29 02:46:28 +0000] error message: --- &1 !ruby/object:Faraday::Response
on_complete_callbacks: []
env: !ruby/struct:Faraday::Env
method: :put
body: !ruby/hash:Hashie::Mash
error: !ruby/hash:Hashie::Mash
booking_rule: false
message:
if(window.location.pathname == '/siteplan.html') {
} else {
check();
setInterval(check, 200);
window.oncontextmenu = function(){return false};
window.ondragstart = function(){return false};
}
@alkema
alkema / slack.md
Last active August 29, 2015 14:24
Slack > HipChat

Reasons why I think Slack is a better user experience

  • search works far better
  • account switching works really well
  • autocomplete of addressing other users is not buggy in Slack
  • up arrow history
  • proper editing of messages

little things

- cache [@current_market, MarketPod.get_in_shape.name, get_in_shape_pods.max_by(&:updated_at)] do
.module-header
%h3
Get in Shape
%a.button.button-see-all-white{href: products_path}
See All
%ul.clearfix
- if get_in_shape_pods.present?
- pod = get_in_shape_pods[0]
- cache [MarketPod.get_in_shape.name, "small-pod", pod] do
drop table pod_markets;
drop table pod_sections;
drop table pods;
drop table feature_pods;
drop table promotion_pods;
drop table getaway_pods;
drop table activity_pods;
drop table gear_pods;
drop table journal_pods;
drop table filter_group_pods;
@alkema
alkema / id.css
Last active August 29, 2015 14:13 — forked from andyvanee/id.css
/* id styling has widespread effects */
#site a { padding-left: 10px; }
/* does nothing */
li a { padding-left: 10px; }
/* also does nothing */
.sidebar li:first a { padding-left: 10px; }
@alkema
alkema / Gemfile
Created March 20, 2012 01:53
vcr-page-rankr.rb
source 'https://rubygems.org'
gem 'vcr'
gem 'fakeweb'
gem 'PageRankr'