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
g@desktop:/mnt/c/Node/chrometest$ curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' | |
{ | |
"result":{ | |
"type":"object", | |
"className":"Object", | |
"description":"Object", | |
"objectId":"{\"injectedScriptId\":2,\"id\":1}"} | |
} |
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
# App setup | |
RUN mkdir -p ${FUNCTION_DIR} | |
COPY function/package.json ${FUNCTION_DIR} | |
WORKDIR ${FUNCTION_DIR} | |
# Install deps | |
RUN yarn | |
# Build app (do last for speed) | |
COPY function/. ${FUNCTION_DIR} |
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
#!/bin/sh | |
# Based on: https://medium.com/dot-debug/running-chrome-in-a-docker-container-a55e7f4da4a8 | |
readonly G_LOG_I='[INFO]' | |
readonly G_LOG_W='[WARN]' | |
readonly G_LOG_E='[ERROR]' | |
main() { | |
launch_xvfb |
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
ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie /usr/local/bin/aws-lambda-rie | |
RUN chmod 755 /usr/local/bin/aws-lambda-rie | |
COPY entrypoint.sh / | |
RUN chmod 755 /entrypoint.sh | |
ENTRYPOINT [ "/entrypoint.sh" ] |
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
FROM ubuntu:focal | |
RUN apt-get update; apt-get clean | |
# Add a user for running applications. | |
RUN useradd apps | |
RUN mkdir -p /home/apps && chown apps:apps /home/apps | |
# Install xvfb and other stuff. | |
RUN apt-get install -y xvfb fluxbox wget wmctrl gnupg2 |
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
ARG FUNCTION_DIR="/function" | |
FROM ubuntu:focal | |
ARG FUNCTION_DIR | |
# Install utils for ric | |
RUN apt install -y curl wget git g++ make cmake unzip libcurl4-openssl-dev autoconf libtool | |
# install NodeJS | |
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - |
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 remoteInterface = require('chrome-remote-interface') | |
const chromium = require('chrome-aws-lambda') | |
const launcher = require('chrome-launcher') | |
const chromeFlags = [ | |
'--no-xshm', | |
'--disable-dev-shm-usage', | |
'--single-process', | |
'--no-sandbox', | |
'--no-first-run', |
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
{ | |
"FunctionName": "myFunc", | |
"LastModified": "2017-11-25T19:37:47.620+0000", | |
"MemorySize": 1536, | |
"Environment": { | |
"Variables": { | |
//some stuff | |
} | |
}, | |
"Version": "$LATEST", |
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
var f = $('#shoutbox form').detach(); | |
$('#shoutbox').append(f); | |
var objDiv = document.getElementById("sbf"); | |
objDiv.scrollTop = objDiv.scrollHeight; | |
ul = $('#sbf'); | |
ul.children().each(function(i,li){ul.prepend(li)}) | |
function handler(e) { | |
var target = e.target; | |
$('#sbf').off('DOMNodeInserted', 'div', handler); | |
$('#sbf').append(target); |
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
{ | |
"flyer_item_id" : 167392889, | |
"flyer_id" : 969512, | |
"flyer_type_id" : 3800, | |
"merchant_id" : 2332, | |
"brand" : "", | |
"display_name" : "Blueberries", | |
"name" : "Blueberries", | |
"description" : "Product of Chile, no. 1 grade\n6 OZ", | |
"current_price" : "5.0", |
NewerOlder