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
version: '2' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ports: | |
- 22181:2181 | |
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
package dev.namtx.leetcode.daily; | |
public class ReverseVowelsOfAString { | |
public static void main(String[] args) { | |
System.out.println(new ReverseVowelsOfAString().reverseVowels("aA")); | |
} | |
public String reverseVowels(String s) { | |
char[] chars = s.toCharArray(); | |
int left = 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
package dev.namtx.leetcode.daily; | |
/** | |
* https://leetcode.com/problems/minimum-genetic-mutation | |
*/ | |
public class MinimumGeneticMutation { | |
public int minMutation(String start, String end, String[] bank) { | |
boolean[] checked = new boolean[bank.length]; | |
int min = minMutation(start, end, bank, checked, 0); | |
if (min == Integer.MAX_VALUE) return -1; |
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
// Credit to https://stackoverflow.com/a/59843241/3422559 | |
import { useEffect, useRef } from "react"; | |
const usePrevious = (value, initialValue) => { | |
const ref = useRef(initialValue); | |
useEffect(() => { | |
ref.current = value; | |
}); | |
return ref.current; |
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
const AMAZON_SELLER_NOTIFICATION_LABEL_NAME = "Amazon Seller Notification"; | |
const NOTIFICATION_SUBJECT_PREFIX = "Sold, ship now:"; | |
const ORDER_ID_REGEX = "Order ID: 113-3770207-6613845"; | |
const MANAGE_ACCOUNT_SHEET_NAME = "MANAGE ACCOUNT"; | |
const AMZ_MAILS_SHEET_NAME = "AMZ MAILS"; | |
const IGNORED_ORDERS_SHEET_NAME = "Ignored Orders"; | |
const _ = LodashGS.load(); | |
const ORDER_DETAIL_MAPPINGS = { | |
shipBy: /(?:Ship by: )(.+)\n/, |
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
package dev.namtx.leetcode; | |
import java.util.Arrays; | |
public class PartitionEqualSubsetSum { | |
public static final int UNCALCULATED = -1; | |
public static final int IMPOSSIBLE = 1; | |
public static final int POSSIBLE = 0; | |
public static void main(String[] args) { |
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
package dev.namtx.leetcode; | |
import java.util.*; | |
/** | |
* https://leetcode.com/problems/find-all-possible-recipes-from-given-supplies/ | |
* | |
* tags: topological sort, dfs | |
*/ | |
public class FindAllPossibleRecipesFromGivenSupplies { |
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
{ | |
"id": "f608af19-c772-4e9a-8b9c-d733d924743a", | |
"name": "Assignment - Local", | |
"values": [ | |
{ | |
"key": "accessToken", | |
"value": "", | |
"enabled": true | |
}, | |
{ |
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
provider "google" { | |
project = var.google_project_id | |
region = var.region | |
zone = var.az | |
} | |
resource "google_compute_instance" "k3s_master_instance" { | |
name = "k3s-master" | |
machine_type = "n1-standard-1" | |
tags = ["k3s", "k3s-master", "http-server", "https-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 | |
kind: ServiceAccount | |
metadata: | |
name: admin-user | |
namespace: kube-system | |
--- | |
# Create ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: |
NewerOlder