Skip to content

Instantly share code, notes, and snippets.

View dafurman's full-sized avatar

David Furman dafurman

View GitHub Profile
@dafurman
dafurman / org_contributions.py
Created February 11, 2024 21:16
Print the top 10 Github contributors in some repos in an org since a given date
#!/usr/bin/env python3
# Note: For my simple use case, repo count is hardcoded to 3 repos from the same owner. Adjust this to whatever you need.
import sys
import time
from collections import defaultdict
from ghapi.all import GhApi
if len(sys.argv) < 7 or len(sys.argv) > 8:
print("Usage: {} token owner repo1 repo2 repo3 start_date [verbose]".format(sys.argv[0]))
@dafurman
dafurman / contributions.py
Last active February 11, 2024 05:08
Print the top 10 Github contributors to a repo since a given date
#!/usr/bin/env python3
import sys
import time
from collections import defaultdict
from ghapi.all import GhApi
if len(sys.argv) < 5 or len(sys.argv) > 6:
print("Usage: {} token owner repo start_date [verbose]".format(sys.argv[0]))
sys.exit(1)
@dafurman
dafurman / linesChanged.sh
Created February 4, 2024 02:45
Count lines changed in PRs
#!/bin/zsh
# Put this the repo you want to examine
if [ $# -eq 0 ]; then
echo "Please provide PR numbers as arguments."
exit 1
fi
prs=("$@")
@dafurman
dafurman / filesChanged.sh
Created February 4, 2024 02:42
Count files changed in PRs
#!/bin/zsh
# Put this the repo you want to examine
if [ $# -eq 0 ]; then
echo "Please provide PR numbers as arguments."
exit 1
fi
prs=("$@")
@dafurman
dafurman / listClasses.swift
Created November 13, 2023 23:21 — forked from macabeus/listClasses.swift
List all classes that subscribe a protocol
// Many thanks to Code Different: http://stackoverflow.com/a/42749141/3440266
import Foundation
struct ClassInfo : CustomStringConvertible, Equatable {
let classObject: AnyClass
let classNameFull: String
let className: String
init?(_ classObject: AnyClass?) {
guard classObject != nil else { return nil }
import SwiftUI
import Dependencies
private struct TextView: View {
let title: String
let text: String
var body: some View {
HStack {
Text(title)
@dafurman
dafurman / GQL+Conveniences.swift
Created March 29, 2023 19:42
Apollo GraphQLNullable Conveniences
import ApolloAPI
import Foundation
public extension EnumType {
var gqlEnum: GraphQLEnum<Self> {
GraphQLEnum(self)
}
/// Converts an `EnumType` into a `GraphQLNullable<GraphQLEnum<EnumType>>` for compatibility with GQL query and mutation inputs.
var gqlEnumNullable: GraphQLNullable<GraphQLEnum<Self>> {