Skip to content

Instantly share code, notes, and snippets.

View trello-cards-from-csv.rb
#!/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
View results.txt
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
@tpitale
tpitale / gist:b3e19f903a0bfd825792
Created Apr 23, 2015
Traceroute to use.typekit.com
View gist:b3e19f903a0bfd825792
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 * * *
View gist:106549
class Exits
include Garb::Resource
metrics :exits, :exit_rate
dimensions :request_uri
end
View gist:106554
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
View gist:106552
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
View gist:114839
class Search
include DataMapper::Resource
property :id, Serial
end
class Result
include DataMapper::Resource
property :id, Serial
belongs_to :search
end
View gist:114857
#!/usr/bin/env ruby
#
# A one file test to show ...
require 'rubygems'
require 'dm-core'
# setup the logger
DataMapper::Logger.new(STDOUT, :debug)
View gist:114964
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
View gist:124989
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"
You can’t perform that action at this time.