Skip to content

Instantly share code, notes, and snippets.

@cn007b
cn007b / 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);
@cn007b
cn007b / 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)
@cn007b
cn007b / 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
@cn007b
cn007b / 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)

@cn007b
cn007b / superSimpleGOExamples.md
Last active April 17, 2020 09:45
Super simple GO examples

Super simple GO examples

Super simple golang code examples:

cli.go:

package main

import (
@cn007b
cn007b / 1.2.jpeg
Last active August 12, 2019 21:01
scaling
1.2.jpeg
@cn007b
cn007b / protocols.md
Last active August 12, 2019 20:36
protocols

Protocols

{
"executions": [
{
"id": 132,
"status": "succeeded",
"project": "TEST-Sylvain",
"executionType": "user",
"user": "sthirard",
"date-started": {
"unixtime": 1560946609000,
@cn007b
cn007b / no_uflfetch.go
Created May 3, 2019 09:14
Fetch (scrape) product's data by net/http not uflfetch
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
)
func main() {
@cn007b
cn007b / Makefile
Last active April 10, 2019 16:09
Deploy AWS Fargate Service - deploy
delete_old_versions:
aws ecs list-task-definitions --sort=DESC \
| grep -Eo $(YourSrvc)':[0-9]+' \
| tail -n +2 \
| while read v; do aws ecs deregister-task-definition --task-definition=$$v; done