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 | |
require 'trello' # ruby-trello gem | |
require 'csv' | |
# | |
# export TRELLO_DEVELOPER_PUBLIC_KEY=yourkeyfrom # https://trello.com/app-key | |
# export BOARD_NAME=nameofboardtoimportto | |
# export MEMBER_NAME=yourusername |
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
Required: dm-core | |
Is inherited public or private in A | |
public | |
Required: dm-active_model | |
Is inherited public or private in B | |
public | |
Required: dm-rails | |
Is inherited public or private in C |
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
traceroute to gp1.wac.v2cdn.net (72.21.91.8), 64 hops max, 52 byte packets | |
1 10.194.112.1 (10.194.112.1) 1.668 ms 1.234 ms 1.043 ms | |
2 * * * | |
3 * * * | |
4 * * * | |
5 * * * | |
6 * * * | |
7 * * * | |
8 * * * | |
9 * * * |
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 Exits | |
include Garb::Resource | |
metrics :exits, :exit_rate | |
dimensions :request_uri | |
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
report = Garb::Report.new(profile) | |
report.metrics :exits, :exit_rate | |
report.dimensions :request_uri | |
# With Filtering and Sort | |
report.filter :request_uri.contains => 'fun', :exits.gte => 1000 | |
report.sort :exit_rate.desc | |
# Getting Results |
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
Exits.results(profile, :limit => 10, | |
:offset => 20, | |
:start_date => (Date.today - 30), | |
:end_date => Date.today) | |
# With Filtering and Sorting | |
Exits.results(profile) do | |
filter :request_uri.contains => 'fun', :exits.gte => 1000 | |
sort :exit_rate |
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 Search | |
include DataMapper::Resource | |
property :id, Serial | |
end | |
class Result | |
include DataMapper::Resource | |
property :id, Serial | |
belongs_to :search | |
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
#!/usr/bin/env ruby | |
# | |
# A one file test to show ... | |
require 'rubygems' | |
require 'dm-core' | |
# setup the logger | |
DataMapper::Logger.new(STDOUT, :debug) |
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 GameMode | |
include DataMapper::Resource | |
property :id, Serial | |
property :title, String | |
property :description, Text | |
property :max_players, Integer | |
has n :games, :through => Resource | |
has n, :types, :through => Resource |
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 "items"."id", "items"."item_code", "items"."item_number", "items"."description", "items"."size", "items"."retail", "items"."vintage" | |
FROM "items" | |
INNER JOIN "sale_items" ON "items"."id" = "sale_items"."item_id" | |
INNER JOIN "sales" ON "sale_items"."sale_id" = "sales"."id" AND "sale_items"."sale_sale_time" = "sales"."sale_time" | |
WHERE "sale_items"."sale_id" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 58) | |
GROUP BY "items"."id", "items"."item_code", "items"."item_number", "items"."description", "items"."size", "items"."retail", "items"."vintage" | |
ORDER BY "items"."id" |