Skip to content

Instantly share code, notes, and snippets.

View zanderwong's full-sized avatar

Zander Wong zanderwong

View GitHub Profile
@bembengarifin
bembengarifin / upsert_table.sql
Last active April 24, 2020 08:01
mysql bulk insert, with duplicate key update (upsert), and with conditional data update
/*
references:
- https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html
- https://stackoverflow.com/questions/32777081/bulk-insert-and-update-in-mysql
- https://thewebfellas.com/blog/conditional-duplicate-key-updates-with-mysql
*/
/* create a new database and use it */
drop database if exists test_upsert;
create database test_upsert;
@octopitus
octopitus / expression.go
Last active February 15, 2022 10:39
Simple Infix to Postfix conversion in Golang using stack.
package main
import (
"strings"
)
func IsOperator(c uint8) bool {
return strings.ContainsAny(string(c), "+ & - & * & /")
}