Skip to content

Instantly share code, notes, and snippets.

elgehelge /
Created March 1, 2024 13:44
Produce GitHub "scoreboard" highlighting users with many stale branches and pull requests
import os
from collections import defaultdict
from datetime import datetime
from datetime import timedelta
import pandas as pd
from github import Github
from tqdm import tqdm
# Replace 'YOUR_GITHUB_TOKEN' with your actual GitHub token
elgehelge /
Created June 19, 2023 08:30
List Github repository contributors according to most stale branches, most branches and most pull requests.

Github Scoreboard (List contributors according to most stale branches)

List Github repository contributors according to most stale branches, most branches and most pull requests.

                     Stale Branches  Branches  Pull Requests
🥇 CodeWizarddd                   3        11              2
🥈 ByteMaster42                   3         7              0
🥉 git-ninja-2000 1 3 1
elgehelge /
Last active September 6, 2021 14:56
Bash script for logging into AWS with MFA (and into ECR)
# Usage: `source <account id> <name> <mfa code>`
# Example: `source 454099695756 john 123456`
token=$(aws sts get-session-token --serial-number arn:aws:iam::$1:mfa/$2 --token-code $3) && \
elgehelge / minimal keras training from generator example
Last active July 20, 2021 10:43
Keras + generator, Minimal example
import numpy as np
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
batch_size = 1
data_size = 1
def generator():
elgehelge /
Last active June 23, 2019 23:27
Minimal example - tensorflow with external generator
import tensorflow as tf
# Data source
def data_generator(start, end):
for x, y in zip(range(start, end), range(start, end)):
print(x, y)
yield x, y
elgehelge /
Last active January 30, 2018 15:37 — forked from peterroelants/
Mnist Inference
"""Script to illustrate inference of a trained tf.estimator.Estimator.
NOTE: This is dependent on which defines the model. can be found at:
import numpy as np
import tensorflow as tf
from mnist_estimator import get_estimator
elgehelge /
Last active May 22, 2022 21:43 — forked from peterroelants/
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.5"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
# Show debugging output
# Set default flags for the output directories
elgehelge /
Last active July 18, 2023 09:22 — forked from t-io/
Install most of my apps with homebrew & cask
# Next time I find myself running this, it is time to upgrade and get some inspiration:
# Show hidden files
defaults write AppleShowAllFiles YES
# Homebrew (cask included)
/usr/bin/ruby -e "$(curl -fsSL"

Keybase proof

I hereby claim:

  • I am elgehelge on github.
  • I am elgehelge ( on keybase.
  • I have a public key ASBPGJHydoH7L_5-JDHSCzpS8YgiMCVM2eG4e_-9TQ8arAo

To claim this, I am signing this object:

import requests
data = {
'apikey' : "9a128231f9bd4d82ac7d28cc74bde19d”,
'user_data': {
'name' : "John Doe",
'email' : "”
'address' : "123 John st. 12345 Doe”
'phone' : "12345678”
'device ID' : "12345ab6cde789f”