This file contains 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
engine: localhost:19076 | |
app: Qonnections2019.qvf | |
script: ./load-script.qvs | |
connections: | |
data: | |
connectionstring: /data | |
type: folder |
This file contains 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
version: "2" | |
services: | |
engine: | |
image: qlikcore/engine:12.368.0 | |
command: -S AcceptEULA=yes -S DocumentDirectory=/docs -S EnableFilePolling=1 | |
ports: | |
- "19076:9076" | |
volumes: | |
- ./core-docs:/docs |
This file contains 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 fs = require('fs') | |
const path = require('path') | |
require('dotenv').config() | |
const { dataFile, saveDirectory} = process.env | |
while(true) { | |
try { | |
fs.renameSync(dataFile, path.join(saveDirectory,`${Date.now()}.csv`)) | |
} catch(e) {} |
This file contains 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
// https://help.qlik.com/en-US/sense-developer/September2018/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/SelectionAPI/qlik-selectionState-interface.htm | |
// here is a basic example of acquiring and working with the current selection | |
// state. Here we can get a list of all fields that have selections and what | |
// values have been selected for each field | |
var selectionState = app.selectionState() | |
var listener = function() { | |
var selections = selectionState.selections | |
// each item in the selectionState.selections is a field |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title></title> | |
<link rel="stylesheet" href="https://playground.qlik.com/playground/resources/autogenerated/qlik-styles.css"> | |
</head> | |
<body> | |
<script type="text/javascript" src="https://playground.qlik.com/playground/resources/assets/external/requirejs/require.js"></script> | |
<script type="text/javascript" src="/node_modules/playground-js-api/dist/playground-js-api.min.js"></script> |
This file contains 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
export class Repo { | |
name: string; | |
forks_count: number; | |
open_issues: number; | |
constructor(json: {}) { | |
this.name = json.name; | |
this.forks_count = json.forks_count; | |
this.open_issues = json.open_issues; | |
} |
This file contains 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 cheerio = require('cheerio') | |
const request = require('request') | |
const mongoose = require('mongoose') | |
const config = require('config') | |
const Publication = require('./server/models/publication') | |
mongoose.Promise = global.Promise | |
let archives = [ | |
["2016", "12"], |
This file contains 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
socket.on('move played', (move) => { | |
// someone has played a move in our game | |
// if the move just played wasn't by us, it is now | |
// our turn to play. | |
if (move.player != playerId) { | |
console.log(`opponent performed ${move.result}`) | |
performMove() | |
} | |
}) |
This file contains 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
let performMove = () => { | |
// this is where we would put our logic for deciding which move to make | |
// here we are just attacking all the time. We should probably be more | |
// creative than this. If we don't heal our Qritter will most likely be | |
// defeated in no time. | |
let body = {action: "attack"} | |
let options = createOptions("moves", "POST", body) |
This file contains 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 io = require("socket.io-client") | |
const request = require("request") | |
const config = require("./config") | |
console.log("Welcome to the Qritter Wars Client") | |
// This is the api key passed to the Qritter Wars REST API in the Authorization header | |
// for authentication | |
// format: base64 encoded value of <apiId>:<apiSecret> | |
const apiKey = new Buffer(`${config.apiId}:${config.apiSecret}`).toString('base64') |