Skip to content

Instantly share code, notes, and snippets.

View Qkessler's full-sized avatar
🏠
(Not) Working from home

Enrique Kessler Martínez Qkessler

🏠
(Not) Working from home
View GitHub Profile
@Qkessler
Qkessler / repo_stats.py
Created March 24, 2020 07:35
Get GH user's most popular repos
Repo = namedtuple('Repo', 'name stars forks')
from collections import namedtuple
def get_repo_stats(user, n=5):
repos = []
for repo in user.get_repos():
if repo.fork:
continue
repos.append(Repo(repo.name, repo.stargazers_count, repo.forks_count))
return sorted(repos, key=lambda x: x.stars, reverse=True)[:n]
@Qkessler
Qkessler / repo_stats.py
Created March 24, 2020 07:35
Get GH user's most popular repos
Repo = namedtuple('Repo', 'name stars forks')
from collections import namedtuple
def get_repo_stats(user, n=5):
repos = []
for repo in user.get_repos():
if repo.fork:
continue
repos.append(Repo(repo.name, repo.stargazers_count, repo.forks_count))
return sorted(repos, key=lambda x: x.stars, reverse=True)[:n]
@Qkessler
Qkessler / repo_stats.py
Created March 24, 2020 07:36
Get GH user's most popular repos
Repo = namedtuple('Repo', 'name stars forks')
from collections import namedtuple
def get_repo_stats(user, n=5):
repos = []
for repo in user.get_repos():
if repo.fork:
continue
repos.append(Repo(repo.name, repo.stargazers_count, repo.forks_count))
return sorted(repos, key=lambda x: x.stars, reverse=True)[:n]
@Qkessler
Qkessler / repo_stats.py
Created March 24, 2020 07:39
Get GH user's most popular repos
Repo = namedtuple('Repo', 'name stars forks')
from collections import namedtuple
def get_repo_stats(user, n=5):
repos = []
for repo in user.get_repos():
if repo.fork:
continue
repos.append(Repo(repo.name, repo.stargazers_count, repo.forks_count))
return sorted(repos, key=lambda x: x.stars, reverse=True)[:n]
@Qkessler
Qkessler / open-or-bring-to-front
Created February 12, 2022 19:17
open-or-bring-to-front is a command line script to be run with some custom keybinding attached to it. It launches the application passed as <launch-command> (see Usage below) if the application hasn't already a window open, which matches with <search-string>. If it does, it brings all the windows of said application to front.
#!/bin/bash
# open-or-bring-to-front
#
# open-or-bring-to-front is a command line script to be run with
# some custom keybinding attached to it. It launches the application
# passed as <launch-command> (see Usage below) if the application hasn't
# already a window open, which matches with <search-string>.
# If it does, it brings all the windows of said application to front.
#