Skip to content

Instantly share code, notes, and snippets.

View srfrnk's full-sized avatar
:octocat:
prancing about

Srfrnk srfrnk

:octocat:
prancing about
View GitHub Profile
type Var struct {
.
.
.
// EnvRef refers to a variable from the process environment whose value will be extracted for use in
// replacing $(FOO).
EnvRef EnvVar `json:"envref" yaml:"envref"`
}
if filepath.Ext(mf.path) == ".json" {
// Unmarshal the YAML instead of directly marshaling to JSON to support future changes of kustomizationFile::marshal method:
k := make(map[string]interface{})
err := yaml.Unmarshal(data, &k)
if err != nil {
return err
}
// Remove `kind` and `apiVersion` so as make minimal changes to original source file:
var uaDeviceDetector=require('ua-device-detector');
var deviceInfo=uaDeviceDetector.parseUserAgent(options);
var re = {
and: [
{
or: [
/\bChrome\b/,
/\bCriOS\b/
]
},
{not: /\bOPR\b/}
]
{
"raw": {
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
"os": {
"windows": false,
"mac": false,
.
.
.
"windows-phone": false,
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36