Skip to content

Instantly share code, notes, and snippets.

View kendallm's full-sized avatar
🌰
It's your world squirrel, I'm just trying to get a nut.

Kendall Morgan kendallm

🌰
It's your world squirrel, I'm just trying to get a nut.
View GitHub Profile
@kendallm
kendallm / datadogRedirect.user.js
Last active December 22, 2023 17:15
Datadog redirect to regional endpoint
// ==UserScript==
// @name Datadog Redirect
// @namespace Tampermonkey Scripts
// @match https://www.datadoghq.com/
// @grant none
// @version 1.0
// @author github.com/kendallm
// @description Datadog redirect to regional endpoint
// ==/UserScript==
@kendallm
kendallm / example-config.jsonnet
Created November 16, 2021 01:05
Example gmailctl configuration for github notifications
// Please refer to https://github.com/mbrt/gmailctl#configuration for docs about
// the config format.
local lib = import 'gmailctl.libsonnet';
// Some useful variables on top
// TODO: Put your email here
local me = 'email@example.com';
local toMe = { to: me };
// Non-@mention GitHub notifications
@kendallm
kendallm / GIF-Screencast-OSX.md
Created July 20, 2021 22:18 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@kendallm
kendallm / vs code extensions
Last active April 26, 2021 22:34
To install run `cat $filename | xargs -L 1 echo code --install-extension`
AdamCaviness.theme-monokai-dark-soda
alanz.vscode-hie-server
alexanderte.dainty-dark-plus-vscode
alexanderte.dainty-vscode
arcticicestudio.nord-visual-studio-code
dnlytras.nord-wave
Equinusocio.vsc-community-material-theme
Equinusocio.vsc-material-theme
equinusocio.vsc-material-theme-icons
fvclaus.sort-json-array
@kendallm
kendallm / setup_assignment_repo.sh
Created October 29, 2020 05:02
Setup student repo
git push --mirror {student_repo}
cd ..
git clone {student_repo}
git remote add upstream {class_repo}
@kendallm
kendallm / plot_formula.py
Created October 20, 2020 23:48
Quickly plot a formula
import matplotlib.pyplot as plt
import numpy as np
import math
x = np.arange(1000)
y = np.log2(x)
plt.plot(x,y, label="log(x)")
plt.legend()
@kendallm
kendallm / euclid.py
Last active October 18, 2020 04:05
Computes GCD of x,y
def euclid(x,y):
if x < y:
temp = y
y = x
x = temp
if y == 0:
return x
return euclid(y, x % y)
@kendallm
kendallm / exponentiation.py
Created October 18, 2020 03:26
Fast exponentiation
def pow(x, y):
if y == 0:
return 1
z = pow(x, y//2)
if y % 2 == 0:
return z * z
return x * z * z
@kendallm
kendallm / closest_power_of_2.py
Created September 13, 2020 20:59
Calculate the nearest power of 2 that is >= n
from math import *
def nearest_power_of_2(n):
return 2 ** ceil(log2(n))
from textwrap import wrap
from math import inf
from collections import Counter
import cv2
import numpy as np
def get_layers():
with open('../input/input_8.txt') as f:
input = wrap(f.readline(), 25)