Skip to content

Instantly share code, notes, and snippets.

View ErikBrendel's full-sized avatar
🏠
Working from home

Erik Brendel ErikBrendel

🏠
Working from home
View GitHub Profile
@ErikBrendel
ErikBrendel / json-schema-04-wp.json
Last active January 10, 2024 11:29
json-schema-04-wp
{
"id": "https://gist.githubusercontent.com/ErikBrendel/aa2ae80174608cd32823d15fd12131b0/raw/462a67a9252a79dd074a6e7c57587bbc79e176f1/json-schema-04-wp.json",
"$schema": "https://gist.githubusercontent.com/ErikBrendel/aa2ae80174608cd32823d15fd12131b0/raw/462a67a9252a79dd074a6e7c57587bbc79e176f1/json-schema-04-wp.json",
"description": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
from typing import List
WEIGHT_RANGE = 3
class Graph4:
edge_weights = ... # type: List[int]
def __init__(self):
self.edge_weights = [-WEIGHT_RANGE, -WEIGHT_RANGE, -WEIGHT_RANGE, -WEIGHT_RANGE, -WEIGHT_RANGE, -WEIGHT_RANGE]
@ErikBrendel
ErikBrendel / codingame.md
Last active May 13, 2020 21:31
Helpful things for codingame.com (in js)

useful stuff for working in js for codingame.com

@ErikBrendel
ErikBrendel / totalBitBucketChanges.js
Last active February 20, 2018 14:38
[BitBucket] Show the total changes of a diff / pullrequest
//this little js snippet tells you the total amount of additions & deletions of a bitbucket PR or a branch comparison.
//Just open up the site, open up your browser console (Ctrl+Shift+K on Firefox) and paste and execute this code.
//It uses XPath to query all span-elements with the right class
function xpathSum(path) {
var iter = document.evaluate(path, document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
var sum = 0;
var thisNode = iter.iterateNext();
while (thisNode) {
var value = parseInt(thisNode.textContent);