Skip to content

Instantly share code, notes, and snippets.


Patrick DeVivo patrickdevivo

View GitHub Profile

Accessing the GitHub API via MySQL

Uses mergestat to access the GitHub API and go-mysql-server.

Currently, only stargazers table is available. GitHub token used is from a "bot" account. Hosted on Fly.

Username: root Password: github

View fetch.sql
name, primary_language,
github_repo_file_content('google', name, 'go.mod') as go_mod
FROM github_org_repos('google')
WHERE primary_language = 'Go'
View commits_by_email_domain.sql
substr(author_email, instr(author_email, '@')+1) AS email_domain --
FROM commits
WHERE parent_count < 2 -- ignore merge commits
GROUP BY email_domain
ORDER BY count(*) DESC
patrickdevivo /
Last active Oct 7, 2020
Contributor email domain distributions

Contributors by Email Domain

AskGit is a tool looking for more (interesting) use cases. This gist takes a look at the email domains of contributors to two major open source code bases (Linux and Kubernetes). askgit-query.sql can be piped into the askgit command to produce the output in k8s-SHA.txt and linux-SHA.txt

  • Commit Count is the total number of commits by contributors with an email address from Domain
  • Unique Emails is the number of unique contributors with an email from Domain
  • Domain is the email domain

Using gitqlite, query for percentage of commit count by author (in this case in facebook/react). Limit to top 25, include a "chart"

View tux_todo.txt
dGGGGMMb ,""""""""""""""""""""""""""""".
@p~qp~~qMb | // TODO make this better 🎉 |
M|@||@) M| _;.............................'
@,----.JM| -'
JS^\__/ qKL
dZP qKRb
dZP qKKb
View deno-hello-world.ts
const names = ["world", "patrick", "deno", "adhoc"]
names.forEach(n => console.log(`hello, ${n}!`))
patrickdevivo / b
Created Nov 2, 2017
blockstack verify
View b
Verifying my Blockstack ID is secured with the address 1NKAeaGUag7tpGxpy6unSrAWRZhXJe5JQx
patrickdevivo / 0_reuse_code.js
Created Oct 18, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
patrickdevivo / fib.asm
Created Nov 3, 2012
Fibonacci sequencer in assembly
View fib.asm
;;; Fibonacci Sequence
SA 0x80
SA 0x00
STOR %rB %rA ; set F(0)=0
SA 0x81