Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lakhansamani on github.
  • I am lakhansamani (https://keybase.io/lakhansamani) on keybase.
  • I have a public key ASCU59s7bo4hFhuGBJchc8II7C_PDkpc1Wi_nzCsyIkqlwo

To claim this, I am signing this object:

@lakhansamani
lakhansamani / main.go
Created July 23, 2021 10:12 — forked from jinzhu/main.go
handle postgres json with gorm
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
func main() {
// Configure reactivesearch query schema
let jsonCode = [
'{',
' "query": [{\n\t}],',
' "settings": {}',
"}"
].join('\n');
let modelUri = monaco.Uri.parse("a://b/reactivesearch.json"); // a made up unique URI for our model
let model = monaco.editor.createModel(jsonCode, "json", modelUri);
// Configures two JSON schemas, with references.
var jsonCode = [
'{',
' "query": {',
' "match_all": {}',
' }',
"}"
].join('\n');
var modelUri = monaco.Uri.parse("a://b/query-schema.json"); // a made up unique URI for our model

Scaffolding Go Project

mkdir project
cd project
go mod init github.com/username/repo-name
{"name": "bob", "age":25}
{"name": "kat", "aget": 20}
[
{
"name": "bob",
"age": 20
},
{
"name": "kat",
"age": 30
}
]
name age
foo 20
bar 10
jhon 30
bob 40
'use strict';
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
const config = process.env.FIREBASE_CONFIG;
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 7.5.2
nodeSets:
- name: default
count: 1
resources: