Skip to content

Instantly share code, notes, and snippets.

@dnek
dnek / eec6.piet-91-correct.gif.invalid
Last active May 6, 2020 18:22
eec6.piet-91-correct.gif
GIF87a � �����������������, p�C�(��E$ a
@dnek
dnek / random-search.js
Created December 6, 2019 12:02
ElasticSearch random search
const result = await client.search({
index: 'xxx',
body: {
query: {
function_score: {
random_score: {}
}
},
size: 5
}
@dnek
dnek / index.js
Created December 6, 2019 11:40
Firebase Cloud Functions x ElasticSearch
const functions = require('firebase-functions')
const { Client } = require('@elastic/elasticsearch')
const config = {
cloud: {
id: 'xxx'
},
auth: {
username: 'xxx',
password: 'xxx'
}
@dnek
dnek / fireFunc.js
Created December 6, 2019 11:21
Nuxt x Firebase Cloud Functions
import firebase from 'firebase/app'
export default async (ctx, inject) => {
const options = {
'functionsLocation': 'asia-northeast1',
'config': {
'apiKey': 'xxxx',
'authDomain': 'xxxx',
'databaseURL': 'xxxx',
'projectId': 'xxxx',