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
#!/usr/bin/env python | |
from github import Github # https://github.com/PyGithub/PyGithub | |
import requests | |
import json | |
import sys | |
import os | |
gitea_url = "http://127.0.0.1:3000/api/v1" | |
gitea_token = open(os.path.expanduser("~/.gitea-api")).read().strip() |
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
#!/usr/bin/env python | |
from github import Github # pip install PyGithub | |
import json | |
import os | |
all = [] | |
g = Github(open(os.path.expanduser("~/.gist")).read()) |
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
#!/usr/bin/env python | |
from github import Github # https://github.com/PyGithub/PyGithub | |
import json | |
import os | |
g = Github(open(os.path.expanduser("~/.gist")).read()) | |
starred = [] | |
for repo in g.get_user().get_starred(): |
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
" Set encoding | |
set fileencodings=ucs-bom,utf-8,default | |
set fileencoding=utf-8 | |
set encoding=utf-8 | |
" Turn on line numbers and linebreak | |
set linebreak | |
set number | |
" Set color schema and syntax highlighting |
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 permutations(lst): | |
count = len(lst) | |
if count == 0: | |
yield lst | |
for i in range(count): | |
for l in permutations(lst[:i] + lst[i+1:]): | |
yield [lst[i]] + l |
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
#!/bin/bash | |
USER=${1:-brighteyed} | |
STARS=$(curl -is "https://api.github.com/users/$USER/starred?per_page=1" | egrep -i '^Link' | egrep -o 'page=[0-9]+' | tail -1 | cut -d= -f2) | |
echo "$STARS starred repos found for $USER" | |
REPO=$(shuf -i1-$STARS -n1) | |
URL=$(curl -s "https://api.github.com/users/$USER/starred?per_page=1&page=$REPO" | jq '.[]|{html_url}' | jq --raw-output '.[]') |