Skip to content

Instantly share code, notes, and snippets.

View AimeeKnight's full-sized avatar
👩‍💻
MLOpsing

Aimee Knight AimeeKnight

👩‍💻
MLOpsing
View GitHub Profile
@AimeeKnight
AimeeKnight / findCombinationsFromDictionary.js
Last active November 21, 2018 14:59
Find all combinations in dictionary
function reduceWord(active, rest, subsequences) {
if (!active && !rest) {
return;
}
if (!rest) {
subsequences.push(active);
} else {
reduceWord(active + rest[0], rest.slice(1), subsequences);
reduceWord(active, rest.slice(1), subsequences);
{"lastUpload":"2020-03-25T21:31:13.539Z","extensionVersion":"v3.4.3"}
@AimeeKnight
AimeeKnight / PULL_REQUEST_TEMPLATE.md
Last active May 15, 2019 16:44
PR Template .github/

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
@AimeeKnight
AimeeKnight / prototype-examples.js
Last active November 14, 2019 21:56
Prototype Examples
// Every object in Javascript has a prototype.
// When a messages reaches an object, JavaScript will attempt to find a property in that object first,
// if it cannot find it then the message will be sent to the object’s prototype and so on.
// Create an alien object
var alien = {
kind: 'alien'
}
// and a person object
@AimeeKnight
AimeeKnight / kubectl.txt
Created January 31, 2022 19:17
Kubectl shortcuts
componentstatuses = cs
configmaps = cm
endpoints = ep
events = ev
limitranges = limits
namespaces = ns
nodes = no
persistentvolumeclaims = pvc
persistentvolumes = pv
pods = po
@AimeeKnight
AimeeKnight / request-id.vcl
Created July 28, 2022 20:46 — forked from mshmsh5000/request-id.vcl
Fastly VCL for X-Request-ID header
# Unique request ID header
sub vcl_recv {
set req.http.X-Request-ID = digest.hash_sha256(now randomstr(64) req.http.host req.url req.http.Fastly-Client-IP server.identity);
#FASTLY recv
}
@AimeeKnight
AimeeKnight / ip-cider.js
Created January 19, 2024 21:51
ip-cider.js
const ipToNumber = (ip) => ip.split('.').reduce((acc, octet) => (acc << 8) + parseInt(octet, 10), 0);
const findConsecutiveIPs = (ips) => {
ips.sort((a, b) => ipToNumber(a) - ipToNumber(b));
const result = [];
let startIP = ips[0];
let endIP = ips[0];
for (let i = 1; i < ips.length; i++) {