- from: https://www.youtube.com/@sasquatchbgames
- Transform Translation:
- Pros
- You’ll have EXTREMELY precise control over movement, acceleration, collisions, and everything
- You don’t need a Rigidbody (unless you want to call OnTriggerEnter2D, then you need a kinematic RB and collider)
- Cons
- More setup as you have to create your own collision detection
- Does not work with physics forces (ex. RB.AddForce)
- Notes:
- Pros
- Use in Update
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
const tls = require("tls"); | |
const fs = require("fs"); | |
const origCreateSecureContext = tls.createSecureContext; | |
tls.createSecureContext = options => { | |
const context = origCreateSecureContext(options); | |
const pem = fs | |
.readFileSync(process.env.NODE_EXTRA_CA_CERTS, { encoding: "ascii" }) |
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
{ | |
"playing card back": { | |
"title": "playing card back", | |
"html": "🂠", | |
"css": "\\1F0A0", | |
"unicode": "U+1F0A0" | |
}, | |
"ace of spades": { | |
"title": "ace of spades", | |
"html": "🂡", |
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
console.log('hi!') |
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
`3343453545`.split('').sort(()=>-1).reduceRight((p,c,i)=>i&&i%3===0?p+=c+',':p+=c,'') |
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
let re = /hello/i; //insensitive | |
// Meta chars | |
re = /^h/; // Starts with lower case h => false | |
re = /^h/i; // Starts with any case h => true | |
re = /--$/i; // end with -- => true | |
re = /^--$/i; // must begin and end with -- => false | |
re = /w.rld/i; // matches any ONE char => true | |
re = /w*d/i; // matches any char 0 or more times => true | |
re = /w?rld/i; // matches optional character => true |
Each programming language has its own tricks up in its sleeve. Many of them are known to developers, and yet some of them are pretty hackish. In this article, I will show you a couple of tricks I find useful. Some of them I've used in practice and others are the new way of solving old problems. Enjoy! https://devinduct.com/blogpost/26/8-useful-javascript-tricks
Ever worked on a grid where the raw data needs to be recreated with the possibility that columns length might mismatch for each row? Well, I have! For ensuring the length equality between the mismatching rows you can use Array.fill method.
let array = Array(5).fill(''); console.log(array); // outputs (5) ["", "", "", "", ""]
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
node_modules | |
build | |
dist | |
.DS_Store | |
*.log | |
.rpt2_cache | |
.rts2_cache_cjs | |
.rts2_cache_es | |
.rts2_cache_umd | |
.vscode |
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
const log = console.log.bind(console); | |
const $ = document.querySelector.bind(document); | |
const $$ = document.querySelectorAll.bind(document); | |
const rnd = { | |
color: () => `#${Math.floor(Math.random()*16777215).toString(16)}`, | |
dec: (min=0.0,max=1.0) => Math.random() * (max - min) + min, | |
int: (min=0,max=1) => Math.floor(Math.random() * (max - min + 1) + min), | |
pick: (array) => array[Math.floor(Math.random() * array.length)] |
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
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin'); | |
const isProd = process.env.NODE_ENV === 'production'; | |
const options = { | |
entry: './src/js/app.js', |