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
/* eslint-disable func-names */ | |
/* eslint-disable no-console */ | |
const Alexa = require('ask-sdk'); | |
const LaunchRequestHandler = { | |
canHandle(handlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'LaunchRequest'; | |
}, | |
handle(handlerInput) { |
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
{ | |
"type": "APL", | |
"version": "1.0", | |
"theme": "dark", | |
"import": [], | |
"resources": [], | |
"styles": {}, | |
"layouts": {}, | |
"mainTemplate": { | |
"parameters": [ |
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
sudo apt-get update | |
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
nvm install --lts | |
npm install -g ask-cli |
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
//Intent handler A calls intent handler B | |
const A_IntentHandler = { | |
canHandle(handlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'IntentRequest' | |
&& handlerInput.requestEnvelope.request.intent.name === 'A_IntentHandler'; | |
}, | |
handle(handlerInput) { | |
// some code | |
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
http.init(0); | |
http.req_copy_headers(0) | |
http.req_set_method(0, "HEAD"); | |
# // Generate the next URL by incrementing the first | |
# // number sequence found and send it back to Varnish. | |
# // If no number sequence is found, the request is skipped. | |
http.req_set_url(0, http.prefetch_next_url()); | |
http.req_send_and_finish(0); |
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
vcl 4.1; | |
import cookieplus; | |
import header; | |
import std; | |
import directors; | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8081"; |
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
varnishtest ESI | |
server s1 { | |
rxreq | |
txresp -body { | |
<html> | |
Before include | |
<!--esi <esi:include src=""/> --> | |
After include | |
} |
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
varnishtest "hash director with sick backend" | |
server s1 -repeat 2 { | |
rxreq | |
expect req.url == "/s1" | |
expect req.http.Host == "host2" | |
txresp -hdr "Server: s1" -body "server1" | |
} -start | |
server s2 { |
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
vcl 4.0; | |
import http; | |
# We define the origin servers | |
# assumption they listen on port 80, please change it if not true | |
backend origin_a { | |
.host = "103.234.96.112"; | |
.port = "80"; | |
} |
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
sub vcl_recv { | |
if (req.http.host == "t1.weiyuzw.com") { | |
set req.backend_hint = origin_t1_weiyuzw; | |
} | |
} |
OlderNewer