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 repositoryUrl = "<https://github.com/Njuelle/github-rag-example>"; | |
| const loader = new GithubRepoLoader(repositoryUrl, { | |
| branch: "main", | |
| recursive: true, | |
| // long file should be ignored to avoid "max token" error | |
| ignoreFiles: ["bun.lockb"], | |
| }); | |
| const docs = await loader.load(); |
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
| actions: { | |
| createUser ({commit}, user) { | |
| commit('CREATING_USER'); | |
| axios.post( | |
| '/api/user/create', | |
| { user: user } | |
| ) | |
| .then(response => { |
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 socket = require('socket.io-client')('http://localhost:1337'); | |
| socket.on('connect', () => { | |
| socket.send('hi'); | |
| }); |
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 io = require('socket.io')(1337); | |
| console.log('Socket listen on port 1337 : '); | |
| io.on('connection', socket => { | |
| console.log('Client connected'); | |
| socket.on('message', msg => { | |
| console.log(`New message : ${msg}`); | |
| }); |
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 | |
| puppeteer = require('puppeteer'), | |
| path = require('path'); | |
| const runInBrowser = async () => { | |
| const | |
| browser = await puppeteer.launch(), | |
| page = await browser.newPage(); | |
| page.on('console', msg => { |
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
| name: kuzzle-connect | |
| description: Connects the SDK to Kuzzle | |
| hooks: | |
| before: | |
| after: | |
| template: default | |
| expected: Successfully connected |
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
| class GoTester extends Tester { | |
| constructor() { | |
| super(); | |
| this.language = 'go'; | |
| this.runCommand = 'go run'; | |
| this.lintCommand = 'golint'; | |
| } | |
| } |
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
| class Tester { | |
| constructor () { | |
| if (new.target === Tester) { | |
| throw new TypeError("Cannot construct Tester instances directly"); | |
| } | |
| } | |
| execLintCommand () { | |
| //return a promise will executing |
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
| //Connects to Kuzzle | |
| kuzzle | |
| .connect() | |
| .then(() => { | |
| console.log('Successfully connected'); | |
| }) | |
| .catch(error => { | |
| console.error(error.message); | |
| }); |
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
| // load the Kuzzle SDK module | |
| const { Kuzzle } = require('kuzzle-sdk'); | |
| // instantiate a Kuzzle client | |
| const kuzzle = new Kuzzle('websocket', { | |
| host: 'kuzzle', | |
| autoReconnect: false | |
| }); | |
| // snippet will be injected here |
NewerOlder