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
import Vue from 'vue'; | |
export const Suspense = Vue.extend({ | |
name: 'Suspense', | |
data: () => ({ | |
resolved: false, | |
}), | |
async created() { | |
const setupMethod = (this.$parent as any).setup; | |
if (!setupMethod) { |
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
<head> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script> | |
<script> | |
const worker_function = () => { | |
onmessage = () => { | |
console.log('from web worker') | |
this.window = this | |
importScripts('https://cdn.jsdelivr.net/npm/[email protected]/setImmediate.min.js') | |
importScripts('https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]') |
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
############################################################## | |
# This file is intended to be used with ./docker-compose.yml # | |
############################################################## | |
FROM node:10.14.1-alpine as build | |
# working directory | |
WORKDIR /usr/src/app | |
# global environment setup : yarn + dependencies needed to support node-gyp | |
RUN apk --no-cache --virtual add \ |
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
/* | |
* | |
* Return SQLite3 query results as a Nodejs stream, sensitive to backpressure. | |
* | |
* Assumes a foo.db file with a lot of rows - I used 1000 with a number & a string | |
*/ | |
const stream = require('stream'); | |
const sqlite = require('sqlite3'); | |
class DBStream extends stream.Readable { |
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 Bundler = require('parcel-bundler'); | |
const childProcess = require('child_process'); | |
const file = 'index.js'; | |
const options = {}; | |
const bundler = new Bundler(file, options); | |
const runBundle = process.argv.includes('run'); | |
let bundle = null; |
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 path = require('path'); | |
const SOURCE = 'src'; | |
const SOURCE_PATH = path.resolve(SOURCE) + '/'; | |
const removeSourceDirName = path => | |
path.replace(new RegExp(`^${SOURCE}\/?`, 'gi'), ''); | |
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
# update and install ntp | |
yum update -y | |
yum install ntp -y | |
systemctl enable ntpd --now | |
# Install crictl, for Cri-o, but did not work with k8s 1.10 as of yet. | |
curl -L -O https://github.com/kubernetes-incubator/cri-tools/releases/download/v1.0.0-beta.0/crictl-v1.0.0-beta.0-linux-amd64.tar.gz | |
tar xvf crictl-v1.0.0-beta.0-linux-amd64.tar.gz | |
# mv crictl /usr/local/bin/crictl |
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
<template> | |
<div id="app"> | |
<button :disabled="loading" @click="triggerAction">Trigger action</button> | |
<div v-if="loading">Loading....</div> | |
<div v-else>Not loading</div> | |
</div> | |
</template> | |
<script> | |
export default { |
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
#!/bin/bash | |
ELKSERVER=${1:-localhost} | |
ELKPORT=${2:-9200} | |
if [ -z "$ELKSERVER" ]; then | |
# Usage | |
echo 'Usage: check-health.sh <elk-server=localhost> <elk-port=9200>' | |
# create-index.sh "logstash-solr-*" | |
else | |
curl -s "http://$ELKSERVER:$ELKPORT/_cat/health?v" |
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
import numpy as np | |
import cv2 | |
import dlib | |
from scipy.spatial import distance as dist | |
from scipy.spatial import ConvexHull | |
PREDICTOR_PATH = "../data/dlib_models/shape_predictor_68_face_landmarks.dat" | |
FULL_POINTS = list(range(0, 68)) | |
FACE_POINTS = list(range(17, 68)) |
NewerOlder