This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "green-foxes-todo", | |
"version": "1.0.0", | |
"description": "This is the reddit green foxes todo web project.", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"postinstall": "gulp", | |
"start": "node app.js" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def each(array) | |
i = 0 | |
while i < array.length | |
yield(array[i]) | |
i += 1 | |
end | |
end | |
def find(array) | |
each(array) {|element| return element if yield(element)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def largestEvenSum(self, nums: List[int], k: int) -> int: | |
if k > len(nums): | |
return -1 | |
evens = [-n for n in nums if n % 2 == 0] | |
odds = [-n for n in nums if n % 2 == 1] | |
heapq.heapify(evens) | |
heapq.heapify(odds) | |
if k == 1: | |
return -(evens[0]) if len(evens) > 0 else -1 | |
sum = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TimeMap: | |
def __init__(self): | |
self._tm: dict[str, dict[int, str]] = {} | |
self._stamps: dict[str, list[int]] = defaultdict(list) | |
def set(self, key: str, value: str, timestamp: int) -> None: | |
self._stamps[key].append(timestamp) | |
if key not in self._tm: | |
self._tm[key] = {} | |
self._tm[key][timestamp] = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
name: consul | |
datacenter: dc1 | |
tls: | |
enabled: false | |
connectInject: | |
enabled: true | |
controller: | |
enabled: true | |
server: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
data: | |
token: NjFmNjlhMjctMDI4ZC1hZDc2LWU0ZTUtYjUzODMzNGNhZjNl | |
kind: Secret | |
metadata: | |
labels: | |
managed-by: consul-k8s | |
name: nsbug-apigw-consul-bootstrap-acl-token | |
namespace: consul | |
type: Opaque |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from collections import defaultdict, deque | |
from dataclasses import dataclass | |
from typing import Any, Dict, List, Optional, Set # noqa | |
import ipdb # type: ignore | |
class Node: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/zsh | |
dir=$1 | |
sess=grind3 | |
mkdir ./$sess/$dir | |
cd ./$sess/$dir | |
touch __init__.py | |
touch main.py | |
echo 'from dataclasses import dataclass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from dataclasses import dataclass | |
from typing import Any, List, Optional # noqa | |
import ipdb # type: ignore | |
class Solution: | |
functions = { | |
"+": (lambda x, y: x + y), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
name: basic | |
nodes: | |
- role: control-plane | |
image: kindest/node:v1.25.3 | |
- role: worker | |
image: kindest/node:v1.25.3 |
OlderNewer