Skip to content

Instantly share code, notes, and snippets.

@yetnelson
yetnelson / struct_tag_manipulation
Created May 12, 2022 03:08 — forked from rohanthewiz/struct_tag_manipulation
JSON Marshal based on custom struct tags
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type User struct {
Username string `json:"user" db:"username"`
@yetnelson
yetnelson / a_shell_test.scala
Created April 16, 2019 08:25 — forked from ssimeonov/a_shell_test.scala
SPARK-9210 test: Spark SQL first() vs. first_value()
// This code is designed to be pasted in spark-shell in a *nix environment
// On Windows, replace sys.env("HOME") with a directory of your choice
import java.io.File
import java.io.PrintWriter
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.SaveMode
import org.apache.spark.sql.SaveMode
val ctx = sqlContext.asInstanceOf[HiveContext]
@yetnelson
yetnelson / reflection.go
Created July 1, 2017 05:41 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`