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
declare global { | |
namespace NodeJS { | |
interface ProcessEnv { | |
YOU_ENV: string | |
} | |
} | |
} | |
// If this file has no import/export statements (i.e. is a script) | |
// convert it into a module by adding an empty export statement. |
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
use std::thread::sleep; | |
use std::time::Duration; | |
use anyhow::Result; | |
#[tokio::main] | |
async fn main() -> Result<()> { | |
sleep_and_run_and_return_string(1000).await; | |
println!("I have been waiting for 1 seconds"); | |
Ok(()) | |
} |
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
use serde::{ Serialize, Deserialize }; | |
// Allowed the main function to be async, specifies our async code will be executed by the tokio runtime | |
#[tokio::main] | |
async fn main() -> Result<(), reqwest::Error> { | |
// print!("{:#?}", add_todos().await); | |
Ok(()) | |
} | |
async fn add_todos() -> Result<Todo, reqwest::Error> { |
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
fn main() { | |
// let a = [1, 2, 3]; | |
// let mut v1: Vec<i32> = Vec::new(); | |
// let v2 = vec![1, 2, 3]; | |
let mut v = vec![1, 2, 3, 4, 5]; | |
match v.get(2) { | |
Some(third) => println!("The third element is {}", third), | |
None => println!("There is no third element"), |
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
use anyhow; | |
use anyhow::Result; | |
use thiserror::Error; | |
#[tokio::main] | |
async fn main() -> Result<()> { | |
match always_error() { | |
Ok(()) => println!("Success!"), | |
Err(err) => println!("The error message is: {}", err), | |
} |
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
#[derive(Deserialize, Debug)] | |
struct Header { | |
pub alg: String, | |
} | |
let header = base64 | |
::decode_engine( | |
"JWT Header", | |
&FastPortable::from(&alphabet::STANDARD, fast_portable::NO_PAD) | |
) |
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
import { | |
BedrockRuntimeClient, | |
InvokeModelCommand | |
} from "@aws-sdk/client-bedrock-runtime"; | |
const client = new BedrockRuntimeClient({ region: "us-east-1" }); | |
const textDecoder = new TextDecoder("utf-8"); | |
const command = new InvokeModelCommand({ | |
modelId: "ai21.j2-mid-v1", |
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
name: Create Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-latest |
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
declare module 'react-native-svg-animations' { | |
interface AnimatedSVGPathProps { | |
d: string; | |
strokeColor?: string; | |
strokeWidth?: number; | |
strokeLinecap?: string; | |
easing?: any; | |
duration?: number; | |
width?: number; |