View circle.yml
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" |
View gist:e3896f9288d19ac1f7a5
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 |
View heroku-bin
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 |
View test_csv.js
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() |
View k8s_contributors.sql
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 |
View over_10_contributors.sql
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 |
View issues.sql
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 ( |
View by_commit.sql
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, | |
EXACT_COUNT_DISTINCT(author.name) AS authors, | |
EXACT_COUNT_DISTINCT(committer.name) AS committers, | |
COUNT(*) AS commits | |
FROM | |
[bigquery-public-data:github_repos.commits] | |
WHERE | |
committer.date >= TIMESTAMP("2016-01-01 00:00:00") | |
AND committer.date < TIMESTAMP("2017-01-01 00:00:00") |
View project_commits.sql
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, | |
EXACT_COUNT_DISTINCT(author.name) AS authors, | |
EXACT_COUNT_DISTINCT(committer.name) AS committers, | |
COUNT(*) AS commits | |
FROM | |
[bigquery-public-data:github_repos.commits] | |
WHERE | |
repo_name IN ( "torvalds/linux", | |
"facebook/react-native", |
OlderNewer