π―
This file contains hidden or 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
# Frontend Design Guideline | |
This document summarizes key frontend design principles and rules, showcasing | |
recommended patterns. Follow these guidelines when writing frontend code. | |
# Readability | |
Improving the clarity and ease of understanding code. |
This file contains hidden or 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
import pytorch_lightning as pl | |
import numpy as np | |
import torch | |
from torch.nn import MSELoss | |
from torch.optim import Adam | |
from torch.utils.data import DataLoader, Dataset | |
import torch.nn as nn | |
class SimpleDataset(Dataset): |
This file contains hidden or 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
# coding=utf-8 | |
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
# 1) Install dependencies: pip install cohere datasets elasticsearch==8.6.2 | |
# 2) Start a local Elasticsearch server: docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:8.6.2 | |
# 3) Get your Cohere API key and past it below | |
from elasticsearch import Elasticsearch, helpers | |
import cohere | |
from datasets import load_dataset | |
# Get your cohere API key on: www.cohere.com |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy", | |
"Statement": [ | |
{ | |
"Sid": "example-statement-ID", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, |
This file contains hidden or 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
package cmd | |
import ( | |
"context" | |
"database/sql" | |
"flag" | |
"fmt" | |
// mysql driver | |
_ "github.com/go-sql-driver/mysql" |
This file contains hidden or 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 web3 = require('@solana/web3.js'); | |
const splToken = require('@solana/spl-token'); | |
(async () => { | |
//create connection to devnet | |
const connection = new web3.Connection(web3.clusterApiUrl("devnet")); | |
//generate keypair and airdrop 1000000000 Lamports (1 SOL) | |
const myKeypair = web3.Keypair.generate(); |
This file contains hidden or 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
// calling token program to burn some tokens | |
invoke( | |
&spl_token::instruction::burn( | |
&spl_token::id(), | |
user_token_account_ai.key, | |
vending_machine_mint.key, | |
&user.key, | |
&[], | |
price, | |
)?, |
NewerOlder