This file contains hidden or 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
from collections import defaultdict | |
import re | |
from subprocess import CalledProcessError, run, PIPE, STDOUT | |
# Dump list of changed files | |
# git diff --name-only v6.6.3 master | |
# Log of changes to a file between two commits | |
# git log v6.6.3..master views/qcs_task/index.rhtml |
This file contains hidden or 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 search(a, n): | |
low = 0 | |
high = len(a) - 1 | |
while True: | |
mid = low + high // 2 | |
v = a[mid] | |
if v == n: |
This file contains hidden or 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 linesize 200 | |
set pagesize 50000 | |
column some_name format a30 | |
-- More ideas at https://docs.oracle.com/cd/A57673_01/DOC/server/doc/SP33/ch4.htm |
This file contains hidden or 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
{ | |
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"o/master\":{\"target\":\"C2\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"my-stuff\":{\"target\":\"C3\",\"id\":\"my-stuff\",\"remoteTrackingBranchID\":\"o/my-stuff\"},\"o/my-stuff\":{\"target\":\"C3\",\"id\":\"o/my-stuff\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"}},\"tags\":{},\"HEAD\":{\"target\":\"my-stuff\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"my-stuff\":{\"target\":\"C3\",\"id\":\"my-stuff\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3 |
This file contains hidden or 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
""" | |
Summarize access to an organization's repositories on GitHub. | |
Run a query like this on the GitHub explorer: | |
https://developer.github.com/v4/explorer/ | |
{ | |
organization(login: "your-org") { | |
name | |
repositories(first: 100) { |
This file contains hidden or 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
t=dict(r='<rect x="{}" y="{}" width="{}" height="{}" fill="{}"/>',p='<path d="{}" stroke="{}" stroke-width="{}" stroke-dasharray="{}" fill-rule="{}" fill="{}"/>',c='<circle cx="{}" cy="{}" r="{}" fill="{}"/>') | |
s=(ord(input()[0])|32)-97 | |
open('a.svg','w').write(f'<svg xmlns="http://www.w3.org/2000/svg" width="60" height="40">{"".join(t[o[0]].format(*(o[1:].split(":")))for o in"r0:0:30:40:#fff;pM 60,0 H 30 V 40 H 60 L 40,20:0:0:0::#003298|pM 60,0 H 0 V 40 H 60 L 40,20:0:0:0::#f00|r0:0:60:40:#039;r0:8:60:24:#fff;r0:16:60:8:#f00|r0:0:60:40:#fbfc01;r0:13.3:60:13.3:#003298|r0:0:60:20:#039;r0:20:60:20:#f00|r0:0:60:40:#fff;pM 30,0 L 0,20 L 30,40 L 60,20:0:0:0::#f00|r0:0:60:40:#ff0;r10:0:10:40:#039;r30:0:10:40:#039;r50:0:10:40:#039|r0:0:30:40:#fff;r30:0:30:40:#f00|r0:0:60:40:#ff0;c30:20:10.7:#000|r0:0:60:40:#039;r0:13.3:60:13.3:#fff|r0:0:30:40:#ff0;r30:0:30:40:#039|pM0,0H60V40H0:0:0:0::#FF0;pM0,20H60V0H30V40H0:0:0:0::#0|r0:0:60:40:#039;pM 0,0 L 60,40 M 0,40 L 60,0:#fff:10:0::#0|r0:0:60:40:#039;pM 0,0 H 60 V 10 H 0 z M |
This file contains hidden or 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
from pathlib import Path | |
from matplotlib import pyplot as plt | |
import pandas as pd | |
import requests | |
import seaborn as sn | |
DATA_PATH = Path('data') | |
This file contains hidden or 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
from math import ceil | |
from matplotlib import pyplot as plt | |
plot_count = 8 | |
column_count = 2 | |
row_count = int(ceil(plot_count/column_count)) | |
fig, subplot_axes = plt.subplots(row_count, | |
column_count, | |
squeeze=False, |
This file contains hidden or 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
from Queue import Empty, Queue | |
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, Namespace | |
from glob import glob | |
import os | |
from itertools import count | |
from threading import Thread | |
from time import sleep | |
This file contains hidden or 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
import os | |
from subprocess import check_output, CalledProcessError | |
from logging import getLogger, basicConfig, INFO | |
logger = getLogger('main') | |
def report_progress(message='Progress', progress=0, limit=None): | |
try: | |
process_ids = list(map( |
NewerOlder