If you are using this already, consider changes soon due the discussion around current ESX proposal.
Feel free to keep an eye on udomsay as that will be the implementation reference for consumers.
// First, let's look at the traditional visitor pattern | |
// This is how we might implement a simple expression evaluator | |
// Traditional Visitor Pattern | |
namespace Traditional { | |
// Abstract base class for expressions | |
abstract class Expr { | |
abstract accept<T>(visitor: ExprVisitor<T>): T; | |
} |
If you are using this already, consider changes soon due the discussion around current ESX proposal.
Feel free to keep an eye on udomsay as that will be the implementation reference for consumers.
/** | |
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts. | |
* | |
* Note that this uses an older fork of stable-diffusion | |
* with the 'txt2img.py' script, and that script was modified to | |
* support the --outfile command. | |
*/ | |
var { spawn, exec } = require("child_process"); | |
var path = require("path"); |
Allow retrieving an OAuth 2.0 authentication token for interacting with Google services using the service account key.
Base64-encode your service account JSON key and save it to *.env
files (GOOGLE_CLOUD_CREDENTIALS
)
import { getAuthToken, Env } from "core";
export default {
This is how to create a .gitignore file in the root file of our Xcode project, this is used to ignore saving certain files that are not necessary in our project, like the files that Xcode automatically generates after each build as DerivedData/ and build/. Saving these files causes unnecessary work and makes it harder to find the significant changes in our commit history. Here's the Terminal commands: | |
If this is the first time you are doing this, you are going to need to run this command, Important: This is a one-time-only command for each computer: | |
git config --global alias.ignore '!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi' | |
Now for each project, do this after creating the project: | |
1. cd -> drag the Xcode project file to terminal in order to get the path | |
2. git ignore swift,macos >.gitignore | |
3. git add .gitignore | |
4. git commit -m "Add .gitignore file" |
a gist to recap the current status, also available as library picker!
do one thing only and do it well
const fetch = require("node-fetch"); | |
const oauthClientUrl = "https://pastebin.com/raw/pS7Z6yyP" | |
const baseUrl = "https://owner-api.teslamotors.com"; | |
function wait(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function getHeaders() { |
If you use server rendering, keep in mind that neither useLayoutEffect
nor useEffect
can run until the JavaScript is downloaded.
You might see a warning if you try to useLayoutEffect
on the server. Here's two common ways to fix it.
If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect
instead.
function MyComponent() {
If you use
create-react-app
, #5136 (released with the 2.0) implements a--use-pnp
option that allows you to easily create a new project using PnP! In this case, just usecreate-react-app --use-pnp
together with Yarn 1.12, and you're good to go! 👍
Plug'n'Play is a new initiative from Yarn that aims to remove the need for node_modules
. It's already available, and has proved being effective even on large-scale infrastructures. This document describes in a few steps how to quickly get started with it. Spoiler alert: it's quite easy 🙂
First, download a package manager that supports it. Yarn 1.12 already does, so that's what we're going to use! To install it, just follow the instructions on our website: https://yarnpkg.com/en/docs/install
If everything is ok, running
yarn --version
should give youv1.12.1
or higher. If you don't get this result maybe a