Skip to content

Instantly share code, notes, and snippets.

View adelevie's full-sized avatar

Alan deLevie adelevie

View GitHub Profile

Finally, the President’s Executive Orders on regulatory reform, which Chairman Genachowski has endorsed, directed federal agencies to review and repeal rules that “may be outmoded, ineffective, . . . or excessively burdensome[.]”14 The Commission’s “Preliminary Plan for Retrospective Analysis of Existing Rules” carries forward that mission. The encryption prohibition rule is a perfect candidate for revision since, at a minimum, it (1) “has been affected by changes in technology … [and] changes in market structure; (2) has a disproportionate or undue burden on particular entities … [and] could result in greater net benefits to the public if modified; and (3) has been subject to frequent requests for waivers by affected stakeholders . . . .”15

Last login: Fri Mar 18 17:47:06 on ttys007
➜ tock git:(CivicVision-328-docker-compose-setup) docker-machine create -d virtualbox --virtualbox-import-boot2docker-vm boot2docker-vm docker-vm
Running pre-create checks...
Creating machine...
(docker-vm) Copying /Users/alandelevie/.docker/machine/cache/boot2docker.iso to /Users/alandelevie/.docker/machine/machines/docker-vm/boot2docker.iso...
(docker-vm) Creating VirtualBox VM...
(docker-vm) Starting the VM...
(docker-vm) Check network to re-create if needed...
(docker-vm) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
➜ tock git:(CivicVision-328-docker-compose-setup) docker-compose build tock
Building tock
Step 1 : FROM python:3.4
3.4: Pulling from library/python
fdd5d7827f33: Already exists
a3ed95caeb02: Pull complete
B/32 Bfe50cc: Pull complete
627b6479c8f7: Pull complete
67c44324f4e3: Pull complete
9ee7e6ec2a05: Pull complete
class AuctionQuery
def initialize(relation = Auction.all)
@relation = relation.extending(Scopes)
end
module Scopes
def delivery_deadline_expired
where('delivery_deadline < ?', Time.zone.now)
end
def complete_and_successful
relation = delivery_deadline_expired(@relation)
relation = delivered(relation)
relation = accepted(relation)
relation = cap_submitted(relation)
relation = paid(relation)
relation
end
class AuctionQuery
def initialize(relation = Auction.all)
@relation = relation
end
def delivery_deadline_expired(relation = @relation)
relation.where!('delivery_deadline < ?', Time.zone.now)
end
def accepted(relation = @relation)
class AuctionQuery
def initialize(relation = Auction.all)
@relation = relation
end
def delivery_deadline_expired
@relation.where('delivery_deadline < ?', Time.zone.now)
end
def accepted
module AuctionQuery
class Base
def initialize(relation = Auction.all)
@relation = relation
end
end
class DeliveryDeadlineExpired < Base
def call
@relation.where('delivery_deadline < ?', Time.zone.now)
@adelevie
adelevie / bids.rb
Created January 26, 2016 02:02
creating some fake bids via API
[1] pry(main)> client.create_bid(amount: 3499, auction_id: 3)
=> {"bid"=>
{"bidder_id"=>1,
"auction_id"=>3,
"amount"=>3499,
"created_at"=>"2016-01-26T02:01:36+00:00",
"updated_at"=>"2016-01-26T02:01:36+00:00",
"id"=>3,
"bidder"=>
{"github_id"=>"86790",
@adelevie
adelevie / auction.json
Created January 26, 2016 01:10
json from a fake auction
{
"auction": {
"issue_url": "https://github.com/18F/micropurchase/pull/170",
"github_repo": "https://github.com/18F/micropurchase",
"start_price": 3500,
"start_datetime": "2015-12-05T17:00:00+00:00",
"end_datetime": "2016-02-27T17:00:00+00:00",
"title": "3d print some 3d printers",
"description": "## Description of issue\r\n\r\nCurrently, CALC uses a [management command to load data](https://github.com/18F/calc/blob/master/contracts/management/commands/load_data.py) from 7 different schedules. We want to load the Schedule 70 data provided into CALC (note, the data will likely need to be reformatted). The data is available here: https://github.com/18F/calc/tree/s70/contracts/docs/s70\r\n\r\n## Acceptance criteria\r\n\r\n1. Either a new Django management command or modification to https://github.com/18F/calc/blob/master/contracts/management/commands/load_data.py to load the Schedule 70 as Contract objects in the database.\r\n2. Whether a new command or a modification to the existin