Skip to content

Instantly share code, notes, and snippets.

FROM mhart/alpine-node:7.9.0
RUN apk update && apk add git
RUN mkdir /app
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
CMD ["npm", "run", "build"]
@kuy
kuy / ERROR-01
Last active April 19, 2017 17:37
// ...
Starting Step #1
Step #1:
Step #1: > foo@ build /app
Step #1: > npm run build:tower && ./node_modules/.bin/webpack
Step #1:
Step #1:
Step #1: > foo@ build:tower /app
Step #1: > ./node_modules/.bin/babel ./node_modules/redux-tower/src --out-dir ./node_modules/redux-tower/lib --ignore __tests__
Starting Step #1
Step #1:
Step #1: > foo@ build /app
Step #1: > ls ./node_modules/redux-tower && npm run build:tower && ./node_modules/.bin/webpack
Step #1:
Step #1: README.md
Step #1: decls
Step #1: package.json
Step #1: react.js
Step #1: webpack.config.js
@kuy
kuy / mapping.md
Created July 23, 2017 15:18
Mapping
curl -XPUT 'localhost:9200/answers?pretty' -H 'Content-Type: application/json' -d'
{
  "mappings": {
    "user": {
      "_all":       { "enabled": false  },
      "properties": {
        "user":   { "type": "integer" },
        "choice": { "type": "keyword" }
 }
@kuy
kuy / answers.md
Created July 23, 2017 15:32
Answers
curl -XPUT 'localhost:9200/answers/user/1?pretty' -H 'Content-Type: application/json' -d'
{
    "user" : 1,
    "choice" : [ "A", "B", "C" ]
}
'
@kuy
kuy / problem.md
Created July 23, 2017 16:57
Problem
curl -XPOST 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "query": {
    "term" : { "choice" : "B" } 
  }
}
'
@kuy
kuy / bool.md
Created July 23, 2017 17:03
Bool
curl -XPOST 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool" : {
      "must_not" : {
        "term" : { "choice" : "A" }
      },
      "must" : {
 "term" : { "choice" : "B" }
@kuy
kuy / script.md
Last active July 23, 2017 17:17
Script
curl -XPOST 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool" : {
      "must" : {
        "term" : { "choice" : "B" }
      },
      "must" : {
 "script" : {
@kuy
kuy / script2.md
Last active July 23, 2017 17:23
Script2
curl -XPOST 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool" : {
      "must" : {
        "term" : { "choice" : "B" }
      },
      "must" : {
 "term" : { "choice" : "C" }
@kuy
kuy / lambda.js
Created September 10, 2018 17:49
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';