Skip to content

Instantly share code, notes, and snippets.

@elgehelge
elgehelge / github_scoreboard.py
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
elgehelge / README.md
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
User                                                    
🥇 CodeWizarddd                   3        11              2
🥈 ByteMaster42                   3         7              0
🥉 git-ninja-2000 1 3 1
@elgehelge
elgehelge / login_aws_mfa.sh
Last active September 6, 2021 14:56
Bash script for logging into AWS with MFA (and into ECR)
#!/bin/bash
# Usage: `source login_aws_mfa.sh <account id> <name> <mfa code>`
# Example: `source login_aws_mfa.sh 454099695756 john 123456`
{
AWS_ACCESS_KEY_ID= && \
AWS_SECRET_ACCESS_KEY= && \
AWS_SESSION_TOKEN= && \
token=$(aws sts get-session-token --serial-number arn:aws:iam::$1:mfa/$2 --token-code $3) && \
@elgehelge
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
elgehelge / test_external_generator_error.py
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
elgehelge / mnist_inference.py
Last active January 30, 2018 15:37 — forked from peterroelants/mnist_inference.py
Mnist Inference
"""Script to illustrate inference of a trained tf.estimator.Estimator.
NOTE: This is dependent on mnist_estimator.py which defines the model.
mnist_estimator.py can be found at:
https://gist.github.com/elgehelge/faf200e2b36edfb1b1a77ec65f74ecab
"""
import numpy as np
import skimage.io
import tensorflow as tf
from mnist_estimator import get_estimator
@elgehelge
elgehelge / mnist_estimator.py
Last active May 22, 2022 21:43 — forked from peterroelants/mnist_estimator.py
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
tf.logging.set_verbosity(tf.logging.DEBUG)
# Set default flags for the output directories
@elgehelge
elgehelge / osx_install.sh
Last active July 18, 2023 09:22 — forked from t-io/osx_install.sh
Install most of my apps with homebrew & cask
#!/bin/sh
# Next time I find myself running this, it is time to upgrade and get some inspiration: https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
# Homebrew (cask included)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Keybase proof

I hereby claim:

  • I am elgehelge on github.
  • I am elgehelge (https://keybase.io/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' : "johndoe@gmail.com”
'address' : "123 John st. 12345 Doe”
'phone' : "12345678”
'device ID' : "12345ab6cde789f”