Skip to content

Instantly share code, notes, and snippets.

@yyscamper
yyscamper / jsonb_remove_keys.sql
Created February 26, 2018 09:49
PostgreSQL: Remove Multiple Keys From JSONB
CREATE OR REPLACE FUNCTION jsonb_remove_keys(
jdata JSONB,
keys TEXT[]
)
RETURNS JSONB AS $$
DECLARE
result JSONB;
len INT;
target TEXT;
@yyscamper
yyscamper / wait-for-it.sh
Created January 7, 2019 09:22
wait-for-it.sh with MAC support
#!/usr/bin/env bash
# Use this script to test if a given TCP host/port are available
# This is script is download from
# https://github.com/vishnubob/wait-for-it/blob/9995b721327eac7a88f0dce314ea074d5169634f/wait-for-it.sh
# Modify by on 2019-1-7, with support for MACOS
# solution is found from:
# - https://github.com/vishnubob/wait-for-it/issues/13
# - https://stackoverflow.com/questions/3504945/timeout-command-on-mac-os-x
@yyscamper
yyscamper / parseFloat.go
Created August 2, 2017 06:59
An advance ParseFloat for golang, support scientific notation, comma separated number
package main
import (
"fmt"
"math"
"strconv"
"strings"
)
func ParseFloat(str string) (float64, error) {
@yyscamper
yyscamper / antchain_baas_deposit_demo.py
Last active March 23, 2023 06:45
蚂蚁区块链BaaS登录、存证、取证示例代码
#!/usr/bin/env python
import base64
import codecs
import json
import logging
import os
import sys
import uuid
from datetime import datetime