Skip to content

Instantly share code, notes, and snippets.

View GerardRodes's full-sized avatar
🐀

Gerard Rodes GerardRodes

🐀
View GitHub Profile
@GerardRodes
GerardRodes / main.go
Last active June 27, 2022 10:59
Go - get field value by tag value
package main
import (
"errors"
"reflect"
)
func GetFieldValueByTagValue[T any](instance any, tagname, tagvalue string) (T, error) {
var noop T
@GerardRodes
GerardRodes / ResultsPage.good.short.vue
Last active March 14, 2019 08:13
Good implementation without data
<template>
<div>
<ul>
<li v-for="item in results" :key="item.id">
{{ item.name }}
</li>
</ul>
<Checkbox
:value="!!$route.query.isNew"
@GerardRodes
GerardRodes / ResultsPage.good.vue
Last active March 14, 2019 08:13
Good implementation
<template>
<div>
<ul>
<li v-for="item in results" :key="item.id">
{{ item.name }}
</li>
</ul>
<Checkbox
:value="filters.isNew"
@GerardRodes
GerardRodes / ResultsPage.bad.vue
Last active March 13, 2019 19:47
Bad implementation
<template>
<div>
<ul>
<li v-for="item in results" :key="item.id">
{{ item.name }}
</li>
</ul>
<Checkbox v-model="filters.isNew" />