Skip to content

Instantly share code, notes, and snippets.

View barrybtw's full-sized avatar
🏠
School stuff

Nicolai Christensen barrybtw

🏠
School stuff
  • Student in Scandinavia
  • Denmark
View GitHub Profile
@barrybtw
barrybtw / main.rs
Last active November 19, 2022 21:26
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use sqlx::sqlite::SqlitePoolOptions;
// add variant for sqlx::Error
#[derive(Debug, thiserror::Error)]
pub fn get_input() -> &'static str {
"
18313
2404
10479
new
7011
10279
1496
10342
@barrybtw
barrybtw / main.rs
Created December 1, 2022 15:15
advent of code, day 1
mod input;
#[derive(Debug, Clone, Copy)]
struct Elf {
calories: u32,
}
impl Elf {
fn new(calories: u32) -> Elf {
Elf { calories: calories }
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
enum Status {
use std::collections::HashMap;
use std::str::FromStr;
enum Token {
Plus,
Minus,
Asterisk,
Slash,
LParen,
RParen,
@barrybtw
barrybtw / main.rs
Last active February 24, 2023 00:34
very clever rust developer
#![allow(dead_code)]
use std::fmt::{Display, Formatter};
struct Sad;
struct Happy;
#[derive(Debug)]
enum RustLevel {
Beginner,
TrashDevLevel,
FROM rust:slim-buster AS builder
WORKDIR /prod
COPY Cargo.lock .
COPY Cargo.toml .
RUN mkdir .cargo
# This is the trick to speed up the building process.
# RUN cargo vendor > .cargo/config
COPY . .
[package]
name = "one1"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
dotenv = "0.15.0"
serenity = "0.11.5"
use dotenv::dotenv;
use std::env;
use serenity::async_trait;
use serenity::framework::standard::macros::{command, group};
use serenity::framework::standard::{CommandResult, StandardFramework};
use serenity::model::channel::Message;
use serenity::prelude::*;
#[group]
0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\Bruger\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@9.4.1
2 info using node@v18.15.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\Bruger\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Bruger\Desktop\dev\app-playground\.npmrc Completed in 1ms