1660390260
Typescript components for Shadow Drive.
Install these dependencies:
yarn add @shadow-drive/sdk
import React, { useEffect } from "react";
import * as anchor from "@project-serum/anchor";
import {ShdwDrive} from "@shadow-drive/sdk";
import { AnchorWallet, useAnchorWallet, useConnection } from "@solana/wallet-adapter-react";
export default function Drive() {
const { connection } = useConnection();
const wallet = useAnchorWallet();
useEffect(() => {
(async () => {
if (wallet?.publicKey) {
const drive = await new ShdwDrive(connection, wallet).init();
}
})();
}, [wallet?.publicKey])
return (
<div></div>
)
}
import {ShdwDrive} from "@shadow-drive/sdk";
const drive = await new ShdwDrive(connection, wallet).init();
package | description |
---|---|
node | Using shadow-drive in a nodejs environment components |
react | Using shadow-drive in a react/browser environment |
git clone https://github.com/genesysgo/shadow-drive.git
cd shadow-drive
yarn install
If you are getting a 400 HTTP error status code when using the POST ShdwDrive
methods such as createStorageAccount
, uploadFile
, addStorage
, etc.
Make sure to set your wallet adapter or connection commitment
config to max
.
<ConnectionProvider endpoint={network} config={{ commitment: 'max' }}>
...
</ConnectionProvider>
const connection = new solanaWeb3.Connection(
"https://ssc-dao.genesysgo.net/",
"max"
);
Author: GenesysGo
Source code: https://github.com/GenesysGo/shadow-drive
#react-native #typescript #javascript
1654588030
TypeScript Deep Dive
I've been looking at the issues that turn up commonly when people start using TypeScript. This is based on the lessons from Stack Overflow / DefinitelyTyped and general engagement with the TypeScript community. You can follow for updates and don't forget to ★ on GitHub 🌹
If you are here to read the book online get started.
Book is completely free so you can copy paste whatever you want without requiring permission. If you have a translation you want me to link here. Send a PR.
You can also download one of the Epub, Mobi, or PDF formats from the actions tab by clicking on the latest build run. You will find the files in the artifacts section.
All the amazing contributors 🌹
Share URL: https://basarat.gitbook.io/typescript/
Author: Basarat
Source Code: https://github.com/basarat/typescript-book/
License: View license
1660390260
Typescript components for Shadow Drive.
Install these dependencies:
yarn add @shadow-drive/sdk
import React, { useEffect } from "react";
import * as anchor from "@project-serum/anchor";
import {ShdwDrive} from "@shadow-drive/sdk";
import { AnchorWallet, useAnchorWallet, useConnection } from "@solana/wallet-adapter-react";
export default function Drive() {
const { connection } = useConnection();
const wallet = useAnchorWallet();
useEffect(() => {
(async () => {
if (wallet?.publicKey) {
const drive = await new ShdwDrive(connection, wallet).init();
}
})();
}, [wallet?.publicKey])
return (
<div></div>
)
}
import {ShdwDrive} from "@shadow-drive/sdk";
const drive = await new ShdwDrive(connection, wallet).init();
package | description |
---|---|
node | Using shadow-drive in a nodejs environment components |
react | Using shadow-drive in a react/browser environment |
git clone https://github.com/genesysgo/shadow-drive.git
cd shadow-drive
yarn install
If you are getting a 400 HTTP error status code when using the POST ShdwDrive
methods such as createStorageAccount
, uploadFile
, addStorage
, etc.
Make sure to set your wallet adapter or connection commitment
config to max
.
<ConnectionProvider endpoint={network} config={{ commitment: 'max' }}>
...
</ConnectionProvider>
const connection = new solanaWeb3.Connection(
"https://ssc-dao.genesysgo.net/",
"max"
);
Author: GenesysGo
Source code: https://github.com/GenesysGo/shadow-drive
#react-native #typescript #javascript
1623574551
Experts say that you can’t become a skilled driver within a week. Driving, like many other skills, requires patience and lots of practice. Even if you’ve been driving for several years, it’s always a good strategy to learn new techniques and keep improving.
In this article, we’ll explain a few tricks that’ll help you become a better driver and avoid unexpected road accidents. These tricks will include everything, starting from taking professional driving lessons in Melbourne to properly using all the features in your car.
So, without any further ado, let’s get started.
1. Learn from Experts
If you’re an absolute beginner, the first step towards becoming a better driver would be to join a dedicated driving school in Melbourne. These schools have professional driving instructors who have years of experience in training novice drivers.
They’ll help you understand the basics of driving and also give you extra tips to stay confident behind the wheel. Another potential benefit of joining a driving school is that it’ll also help you pass the driving license test more easily. Why? Because the instructors will also share different rules and regulations that you must follow during the test.
2. Always Set Your Mirrors Correctly
Another crucial tip that’ll help you become a better driver is to adjust all the mirrors correctly. Many people keep the side mirrors too close that they only see the rear portion of their car and not the actual road.
Keep in mind that if you’re doing this, you won’t be able to know how many cars are behind you and it’ll become challenging to change lanes. So, learn how to adjust the slider mirror and the internal rearview mirror so that you always have a clear view of the back.
3. Maintain a Safe Distance From Other Cars in Traffic
While driving in traffic, make it a habit to maintain a safe distance from the car in front of you. The general thumb rule says that you should keep a distance of at least two full-length cars from the cars in front of you. This way even if the other driver brakes hard, you won’t go colliding into his/her vehicle.
4. Always Use Indicators While Changing Lanes
When it comes to driving in traffic, it’s quite natural to change lanes from time to time. However, switching lanes without using any signals may confuse other drivers and may become the reason for unexpected accidents.
So, while changing lanes, make sure to check the side and rearview mirrors first and then use the correct indicator. If you’re a beginner, your instructor from the driving school in Melbourne will ask you to master this tactic.
#driving school melbourne #driving school near me #driving school south morang #driving lessons melbourne #driving school werribee
1601549700
Today I am going to talk about new features in Typescript 4.0.
TypeScript 4.0 comes with lots of new features to make JavaScript development easier.
You can label tuple elements.
You can write:
type Range = [start: number, end: number];
to restrict args
to have a string and a number.
you can also write:
type Foo = [first: number, second?: string, ...rest: any[]];
to have rest entries in your tuple.
If your tuple has type Foo
, then the tuple starts with a number and a string.
Then the rest of the entries can be anything.
Labels don’t require you to name your variables differently when destructuring.
For example, if you have:
function foo(x: [first: string, second: number]) {
const [a, b] = x;
}
then you can name the destructured variables anything you want.
#software-development #typescript-with-react #typescript #typescript-4 #react native
1674098820
This package contains the source code of the React components for the Cloudscape Design System.
Cloudscape is an open source design system for building intuitive, engaging, and inclusive user experiences at scale. It consists of an extensive set of guidelines to create web applications, along with the design resources and front-end components to streamline implementation.
Cloudscape was built for and is used by Amazon Web Services (AWS) products and services. We created it in 2016 to improve the user experience across AWS web applications, and also to help teams implement those applications faster. Since then, we have continued enhancing the system based on customer feedback and research.
Components APIs and guidelines can be found in the Components section of the Cloudscape website.
For an in-depth guide on getting started with Cloudscape development, check out the Cloudscape website.
All Cloudscape packages are available on npm.
npm install @cloudscape-design/components @cloudscape-design/global-styles
Here is a basic example that renders a primary button:
import Button from '@cloudscape-design/components/button';
import '@cloudscape-design/global-styles/index.css';
function App {
return <Button variant="primary">Click me</Button>;
}
You can also play around with a small example on CodeSandbox:
You can create bug reports or feature requests, or start a discussion to ask a question. To minimize duplicates, we recommend that you search for existing bug reports, feature requests, or discussions before initiating a new thread.
The contribution guidelines contains information on how to contribute, as well as our support model and versioning strategy.
Author: Cloudscape-design
Source Code: https://github.com/cloudscape-design/components
License: Apache-2.0 license