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
macbookair:~/Documents/dev$ git clone https://github.com/dankohn/express-test | |
Cloning into 'express-test'... | |
remote: Counting objects: 863, done. | |
remote: Compressing objects: 100% (724/724), done. | |
remote: Total 863 (delta 81), reused 855 (delta 73) | |
Receiving objects: 100% (863/863), 1.06 MiB | 996.00 KiB/s, done. | |
Resolving deltas: 100% (81/81), done. | |
macbookair:~/Documents/dev$ cd express-test/ | |
macbookair:~/Documents/dev/express-test (master)$ heroku create | |
Creating secret-escarpment-4221... done, stack is cedar |
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
var csv = require('csv') | |
var cat = "Text" | |
var commaCat = "A, B, and C" | |
var cat2 = "More text" | |
csv() | |
.from.array([[cat,commaCat,cat2]]) | |
.to.string( function(innerNest){ | |
console.log(innerNest) | |
csv() |
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
## Customize test commands | |
test: | |
post: | |
- bundle exec rake coveralls:push | |
## Don't have CircleCI create coverage in an unexpected place, as coveralls wouldn't be able to find it. | |
general: | |
artifacts: | |
- "coverage" |
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
def access_own_records | |
return if @user.super_administrator? | |
# Anyone can read or update anything they create | |
[Appointment, Claim, Referral, Study].each do |model| | |
can([:edit, :index, :read, :update], model, | |
model.where(created_id: @user.id)) do |instance| | |
instance.created_id == @user.id | |
end | |
end | |
end |
We can't make this file beautiful and searchable because it's too large.
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
-149.8935557,61.21759217,Starbucks - AK - Anchorage 00001,"601 West Street_601 West 5th Avenue_Anchorage, Alaska 99501_907-277-2477" | |
-149.9054948,61.19533942,Starbucks - AK - Anchorage 00002,"Carrs-Anchorage #1805_1650 W Northern Lights Blvd_Anchorage, Alaska 99503_907-339-0500" | |
-149.7522,61.2297,Starbucks - AK - Anchorage 00003,"Elmendorf AFB_Bldg 5800 Westover Avenue_Anchorage, Alaska 99506" | |
-149.8643361,61.19525062,Starbucks - AK - Anchorage 00004,"Fred Meyer - Anchorage #11_1000 E Northern Lights Blvd_Anchorage, Alaska 995084283_907-264-9600" | |
-149.8379726,61.13751355,Starbucks - AK - Anchorage 00005,"Fred Meyer - Anchorage #656_2300 Abbott Road_Anchorage, Alaska 99507_907-365-2000" | |
-149.9092788,61.13994658,Starbucks - AK - Anchorage 00006,"Fred Meyer - Anchorage (Dimond) #71_2000 W Dimond Blvd_Anchorage, Alaska 995151400_907-267-6700" | |
-149.7364877,61.19533265,Starbucks - AK - Anchorage 00007,"Safeway-Anchorage #1817_7731 E Northern Lights Blvd_Anchorage, Alaska 99504_907-331-1700" | |
-149.8211,61.2156 |
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 | |
actor.login as contributor, | |
COUNT(repo.name) AS commits, | |
FROM | |
[githubarchive:year.2016] | |
WHERE | |
type IN ("PushEvent") AND | |
repo.name = "kubernetes/kubernetes" | |
GROUP BY | |
contributor |
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 | |
repo.name AS repository, | |
COUNT(repo.name) AS commits, | |
EXACT_COUNT_DISTINCT(actor.login) AS contributors | |
FROM | |
[githubarchive:year.2016] | |
WHERE | |
type IN ("PushEvent") | |
GROUP BY | |
repository |
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 | |
repo.name AS repository, | |
COUNT(repo.name) AS commits, | |
EXACT_COUNT_DISTINCT(actor.login) AS contributors | |
FROM | |
[githubarchive:year.2016] | |
WHERE | |
type IN ("PushEvent") | |
GROUP BY | |
repository |
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 | |
repo.name, | |
ROUND(COUNT(*)/EXACT_COUNT_DISTINCT(actor.login),2) comments_per_author, | |
EXACT_COUNT_DISTINCT(actor.login ) authors, | |
COUNT(*) comments | |
FROM | |
[githubarchive:year.2016] | |
WHERE | |
type IN ('IssueCommentEvent') | |
AND actor.login NOT IN ( |
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 | |
repo.name AS repository, | |
COUNT(*) AS pull_requests, | |
EXACT_COUNT_DISTINCT(actor.login) AS contributors | |
FROM | |
[githubarchive:year.2016] | |
WHERE | |
type IN ( 'PullRequestEvent') | |
AND JSON_EXTRACT(payload, '$.action') IN ('"opened"') | |
GROUP BY |
OlderNewer