Minimal example making webpack and wasm/Emscripten work together.
Build instructions:
- Clone this gist
npm install
npm start
- Open
http://localhost:8080
- Look at console
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
// Laser Focused | |
// Ben Ursu | Afrosquared | |
// Spark AR Studio | |
// Instagram | https://www.instagram.com/a/r/?effect_id=206763150244323 | |
Minimal example making webpack and wasm/Emscripten work together.
Build instructions:
npm install
npm start
http://localhost:8080
version: '3.3' | |
services: | |
db: | |
image: mysql:latest | |
volumes: | |
- dbdata:/var/lib/mysql | |
restart: always | |
ports: | |
- "3306:3306" |
/* ----------- API ------------- *\ | |
// Available modules include (this is not a complete list): | |
var Scene = require('Scene'); | |
var Textures = require('Textures'); | |
var Materials = require('Materials'); | |
var FaceTracking = require('FaceTracking'); | |
var Animation = require('Animation'); | |
var Reactive = require('Reactive'); | |
// Example script |
import hash from 'object-hash'; | |
import sizeof from 'object-sizeof'; | |
import lruCache from 'lru-cache'; | |
const cacheEnabled = true; | |
const cacheMaxAge = 30 * 60 * 1000; | |
const cacheMaxSize = 128 * 1000 * 1000; | |
const getCacheKey = config => hash({ | |
method: config.method, |
vec3 gammaCorrect(vec3 color, float gamma){ | |
return pow(color, vec3(1.0/gamma)); | |
} | |
vec3 levelRange(vec3 color, float minInput, float maxInput){ | |
return min(max(color - vec3(minInput), vec3(0.0)) / (vec3(maxInput) - vec3(minInput)), vec3(1.0)); | |
} | |
vec3 finalLevels(vec3 color, float minInput, float gamma, float maxInput){ | |
return gammaCorrect(levelRange(color, minInput, maxInput), gamma); |
<template> | |
</template> | |
<script> | |
import { mapState, mapGetters, mapActions } from 'vuex'; | |
import * as types from './../store/action_types'; | |
export default { | |
components: { }, |
// Replace letters | |
@function str-replace($string, $search, $replace: '') { | |
$index: str-index($string, $search); | |
@if $index { | |
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); | |
} | |
@return $string; | |
} |
/* | |
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a | |
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to | |
that colour and the font colour will be changed to the inverse colour for readability. | |
To use this script in a Google Sheets spreadsheet: | |
1. go to Tools » Script Editor » Spreadsheet; | |
2. erase everything in the text editor; | |
3. change the title to "Set colour preview on edit"; |