Skip to content

Instantly share code, notes, and snippets.

@cn0047
cn0047 / kahnAlgorithm.go
Created May 17, 2024 21:26
Kahn algorithm.
// @see: https://leetcode.com/problems/course-schedule
package main
import (
"fmt"
)
func main() {
edges := [][]int{}
edges = [][]int{{2, 3}, {3, 1}, {4, 0}, {4, 1}, {5, 0}, {5, 2}} // true
@cn0047
cn0047 / ports.json
Created May 5, 2023 05:31
ports.json
{
"AEAJM": {
"name": "Ajman",
"city": "Ajman",
"country": "United Arab Emirates",
"alias": [],
"regions": [],
"coordinates": [
55.5136433,
25.4052165
@cn0047
cn0047 / README.md
Last active May 18, 2022 22:10
Apigee - AssignMessage Set Path

Apigee - AssignMessage Set Path

Here you can find apiproxy resources for AssignMessage > Set > Path examples.

More infor you can find here.

@cn0047
cn0047 / swagger.json
Last active October 11, 2022 16:41
Simple swagger example
{
"swagger": "2.0",
"info": {
"description": "Test API swagger document.",
"version": "1.0.0",
"title": "Test API",
"contact": {
"email": "[email protected]"
},
"license": {

img

@cn0047
cn0047 / tmp.sh
Last active March 4, 2022 08:05
tmp
swagger: "2.0"
info:
version: "1.0.0"
title: "API."
description: "API for dispatch lane and flow rack."
host: td.to-api.com
schemes:
- http
- https
basePath: "/v2"
@cn0047
cn0047 / spanner.md
Created December 22, 2021 21:53
Insert JSON type into Google Cloud Spanner

Insert JSON type into Google Cloud Spanner

Suppose we have this schema:

CREATE TABLE Test (
  ID INT64 NOT NULL,
  Msg STRING(100),
  Data JSON
) PRIMARY KEY(id);
@cn0047
cn0047 / OpenCVBlur.md
Last active November 13, 2020 23:57
OpenCV Blur - Fast/Faster/Fastest | Blur image using OpenCV

OpenCV Blur - Fast/Faster/Fastest

Python

import cv2


def b(f):
 img = cv2.imread(f)
@cn0047
cn0047 / kubeflow_simple_example.md
Last active August 28, 2020 11:32
Kubeflow simple example.

Kubeflow simple example

Simple regression example:

import numpy as np
import tensorflow as tf
@cn0047
cn0047 / MutualRecursion.md
Last active May 26, 2020 14:49
Mutual Recursion

Mutual Recursion

Recursion - when function A calls function A (itself).
Mutual recursion - when function A calls function B, and function B calls function A.

Examples

js (node v13.0.1)