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-env browser */ | |
import type {IRequestWorker} from "./worker.ts"; | |
const worker = new Worker(new URL("./worker.ts", import.meta.url)) as IRequestWorker; | |
// Receive from the worker | |
worker.onmessage = ({data: {myresponse}}) => { | |
console.log(myresponse); | |
}; |
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
// CSS gradient generated by https://www.joshwcomeau.com/gradient-generator/ | |
// hsl(199deg 95% 55%) 0% | |
// hsl(140deg 63% 65%) 50% | |
// hsl(99deg 100% 50%) 100% | |
let gradient = CAGradientLayer() | |
// ... | |
gradient.type = .axial | |
gradient.colors = [ | |
UIColor.hsl(degrees: 199, saturation: 0.95, lightness: 0.55).cgColor, |
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 path = require('path'); | |
var gulp = require('gulp'); | |
var through2 = require('through2'); | |
var File = require('vinyl'); | |
function generate_two_text_files_from_one_json(){ | |
'use strict'; | |
return through2.obj(function(file, enc, next){ | |
var mydata = JSON.parse(file.contents.toString('utf8')); |
Javascript files from the examples folder (such as OrbitControls) are not CommonJS or ES Modules, but they can still be used in Webpack bundles:
In package.json
:
"dependencies": {
"three": "0.84.0",
"webpack": "2.4.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
// Static value by default: | |
// https://caniuse.com/css-variables | |
:root { | |
--example: 0deg; | |
} | |
.myclass { | |
background-image: linear-gradient( var(--example), red, green 50%, blue ); | |
} | |
// Animated value where supported: |
Materials are composed of shader blocks, each block has multiple subroutine variants.
Shader blocks:
The integrity
property for scripts and stylesheets:
- https://caniuse.com/subresource-integrity
- https://w3c.github.io/webappsec-subresource-integrity/
- https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
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
Show hidden characters
{ | |
"autodetect_xhtml": false, | |
"snippets": { | |
"html": { | |
"snippets": { | |
"meta:viewport": "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no\">", | |
"meta:ua": "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">", | |
"js:html5":"<!--[if lt IE 9]>\n<script src=\"\/\/html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n<![endif]-->", | |
"js:empty": "<script>\n(function(){\n\t'use strict';\n\t\/\/\n\t\/\/ TODO\n\t\/\/\n})();\n</script>", | |
"js:webfont2": "<script>\nWebFont.load({\n\tgoogle: {\n\t\tfamilies: ['Droid Sans:n4:i4:n7', 'Droid Serif']\n\t}\n});\n</script>", |
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
/** | |
* This casper scipt checks for 404 internal links for a given root url. | |
* | |
* Usage: | |
* | |
* $ casperjs 404checker.js http://mysite.tld/ | |
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42 | |
*/ | |
/*global URI*/ |