This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import { handler } from './lambda.js' // let's import it dynamically, so we can measure... | |
const evt = { | |
httpMethod: 'GET', | |
path: '/test', | |
headers: {} | |
} | |
const ctx = {} | |
let st = Date.now() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const i18nextPromise = i18next.use(i18nextHttpBackend).init({ | |
debug: true, | |
lng: 'en', | |
fallbackLng: 'en', | |
backend: { | |
loadPath: './locales/{{lng}}/{{ns}}.json' | |
} | |
}); | |
const app = Vue.createApp({}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-undef, new-cap */ | |
i18next | |
.use(i18nextXHRBackend) | |
.use(i18nextBrowserLanguageDetector) | |
.init({ | |
fallbackLng: 'en', | |
backend: { | |
loadPath: '../locales/{{lng}}/{{ns}}.json' | |
}, | |
ns: ['translations'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { translate } from 'react-i18next'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
const { t, i18n } = this.props; | |
const changeLanguage = (lng) => { | |
i18n.changeLanguage(lng); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.i18next) { | |
window.i18next | |
.use(window.i18nextXHRBackend) | |
.use(window.i18nextBrowserLanguageDetector) | |
.init({ | |
debug: false, | |
fallbackLng: 'en', | |
backend: { | |
loadPath: '../locales/{{lng}}/{{ns}}.json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="theme-color" content="#000000"> | |
<title>jQuery App</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js" ></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/i18next/11.6.0/i18next.min.js" ></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-i18next/1.2.1/jquery-i18next.min.js" ></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/i18next-browser-languagedetector/2.2.3/i18nextBrowserLanguageDetector.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const util = require('util'); | |
const Transform = require('stream').Transform; | |
function Slicer (options) { | |
if (!(this instanceof Slicer)) { | |
return new Slicer(options); | |
} | |
Transform.call(this, options); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fastify = require('fastify'); | |
function init(serverFactory) { | |
const app = fastify({ serverFactory }); | |
app.get('/', (request, reply) => reply.send({ hello: 'world' })); | |
return app; | |
} | |
if (require.main === module) { | |
// called directly i.e. "node app" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT db1 | |
PUT db1/table1/_mapping | |
{ | |
"dynamic_templates": [{ | |
"non_analyzed_string": { | |
"match": "*", | |
"match_mapping_type": "string", | |
"mapping": { | |
"type": "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CloudFoundryApi = require('cloud-foundry'); | |
var _ = require('lodash'); | |
var cf_api = new CloudFoundryApi('https....', { | |
token: '.... refresh token' | |
}); | |
cf_api.organizations.list({}, function (err, page) { | |
if (err) { | |
return console.log(err); |
NewerOlder