If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).
Example below explains implications for different implementations.
| function Perceptron(opts) { | |
| if (!opts) opts = {} | |
| var debug = 'debug' in opts ? opts.debug : false; | |
| var weights = 'weights' in opts | |
| ? opts.weights.slice() | |
| : [] | |
| var threshold = 'threshold' in opts |
Edit: This list is now maintained in the rust-anthology repo.
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv to manually rebuild the font cache
| (function(){ | |
| var | |
| is_ios = /iP(ad|od|hone)/i.test(window.navigator.userAgent), | |
| is_safari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); | |
| if ( is_ios && is_safari ) { | |
| var | |
| $html = document.documentElement, | |
| classes = $html.className.concat(' is-ios-safari'); | |
| $html.className = classes; | |
| } |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
| /** | |
| * @author knee-cola / https://github.com/knee-cola | |
| * Original file URL: https://gist.github.com/knee-cola/37875bc4359609b96c9f329cd2a68fa1 | |
| */ | |
| // This is a simple progressive image loader for Three.js | |
| // It enables the smaller image files to be loaded first, | |
| // before the big texture image is fully loaded. | |
| // | |
| // The images are loaded in the order they are passed |
| function readToken (token) { | |
| if (token === '(') { | |
| return { | |
| type: 'OPENING_PARENS' | |
| }; | |
| } else if (token === ')') { | |
| return { | |
| type: 'CLOSING_PARENS' | |
| }; | |
| } else if (token.match(/^\d+$/)) { |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Sine Wave</title> | |
| <script type="text/javascript"> | |
| function showAxes(ctx,axes) { | |
| var width = ctx.canvas.width; | |
| var height = ctx.canvas.height; | |
| var xMin = 0; |
| // Unity C# Cheat Sheet | |
| // I made these examples for students with prior exerience working with C# and Unity. | |
| // Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting |