Git Product home page Git Product logo

last-date's Introduction

GitHub Stats Most Used Languages

See beautiful Mt.Fuji:

Arakurayama Spring
Takabocchi
Saiko
Arakurayama Winter

last-date's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar yammmt avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

last-date's Issues

Add label to group tasks

For me, a lot of tasks are related to cleaning/washing or eating.

I think that it's enough for me to connect one task with zero or one label. Be simple.

Avoid loading huge CSS file

Now, this app uses Bulma CSS in CDN.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">

This CSS file has ALL of Bulma functions, but, it is heavy because I don't use all of them.

According to Bulma customize documents, CSS file generated with following SCSS file is enough for me.

@charset "utf-8";

$section-padding: 1rem 1.5rem;

@import "../bulma-0.8.2/sass/utilities/_all.sass";
@import "../bulma-0.8.2/sass/base/_all.sass";
@import "../bulma-0.8.2/sass/elements/button.sass";
@import "../bulma-0.8.2/sass/elements/container.sass";
@import "../bulma-0.8.2/sass/elements/notification.sass";
@import "../bulma-0.8.2/sass/elements/table.sass";
@import "../bulma-0.8.2/sass/elements/title.sass";
@import "../bulma-0.8.2/sass/form/_all.sass";
@import "../bulma-0.8.2/sass/grid/_all.sass";
@import "../bulma-0.8.2/sass/layout/hero.sass";
@import "../bulma-0.8.2/sass/layout/section.sass";

But there is a problem: a relative path in base.tera is expanded by files which extend base.tera.
So confirm.tera located in /<id>/confirm couldn't read its CSS file ๐Ÿค”

Maybe url_for in Tera's documents resolves it ๐Ÿค”


I think this is not big problem because loading CDN file doesn't seem to take a long time actually.

Bump Diesel from 1.4.8 to 2.x

Abstract: to upgrade Diesel crate, better to wait for the next Rocket release (after v0.5.0-rc.2).

Build error to be fixed

The latest Rocket crate doesn't implement Poolable trait for diesel::SqliteConnection. This invites the build error for this line:

last-date/src/main.rs

Lines 26 to 27 in cfa3b1b

#[database("sqlite_database")]
pub struct DbConn(diesel::SqliteConnection);

How to fix

The master branch of Rocket repo seems to have the commit for this issue (rwf2/Rocket@f0d678d). However, any current Rocket releases do NOT have this commit.

To fix the error I met myself, issues referred the previous commit link could be helpful. However, I do NOT have enough abilities ๐Ÿ˜ข

And, actually, I did NOT confirm that the latest Rocket fixes my error.

Use stable Rust

Next Rust 1.45 covers all nightly feature used by Rocket: we can use stable Rust with Rocket ๐Ÿ˜„

Build fails with Windows OS

Error log from job (https://github.com/yammmt/last-date/actions/runs/4878348259/jobs/8846987232)

     Running `rustc --crate-name ntapi --edition=2018 C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"user\"" -C metadata=ed81b78a94bbc657 -C extra-filename=-ed81b78a94bbc657 --out-dir D:\a\last-date\last-date\target\debug\deps -L dependency=D:\a\last-date\last-date\target\debug\deps --extern winapi=D:\a\last-date\last-date\target\debug\deps\libwinapi-9c8a551f1ec01933.rmeta --cap-lints allow`
error[E0793]: reference to packed field is unaligned
    --> C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\ntexapi.rs:2785:52
     |
2785 |         *tick_count.QuadPart_mut() = read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad);
     |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

error[E0793]: reference to packed field is unaligned
    --> C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\ntexapi.rs:2809:25
     |
2809 |         ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad)
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

For more information about this error, try `rustc --explain E0793`.
error: could not compile `ntapi` due to 2 previous errors

Caused by:
  process didn't exit successfully: `rustc --crate-name ntapi --edition=2018 C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"user\"" -C metadata=ed81b78a94bbc657 -C extra-filename=-ed81b78a94bbc657 --out-dir D:\a\last-date\last-date\target\debug\deps -L dependency=D:\a\last-date\last-date\target\debug\deps --extern winapi=D:\a\last-date\last-date\target\debug\deps\libwinapi-9c8a551f1ec01933.rmeta --cap-lints allow` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 1.

I can find same errors from GitHub:
https://github.com/search?q=language%3ARust+ntapi&type=issues&ref=advsearch

Update "update date" to any date

From 283859b, this app allows us to update the "update date" attribute to only today.
However now I want to update it to NOT today (imagine that when I forgot booting this app).

To keep simplicity, I don't want to add this option to index page. Instead, I'm going to add it to task detail page.

Date update test fails if we run it between 23:59 and 00:00

Here, if date is changed between first line and client.post, this test fails.

last-date/src/tests.rs

Lines 258 to 268 in c25efc5

let today_str = Local::today().naive_local().to_string();
// First, ensure current task date is not today.
assert_ne!(new_tasks[0].updated_at, today_str);
let inserted_id = new_tasks[0].id.unwrap(); // `id` is `Nullable`
let res = client.post(format!("/{}/date", inserted_id)).dispatch();
let mut cookies = res.headers().get("Set-Cookie");
let final_tasks = Task::all(&conn);
assert_eq!(res.status(), Status::SeeOther);
assert!(cookies.any(|value| value.contains("success")));
assert_eq!(final_tasks[0].updated_at, today_str);

Apparently this is not critical issue, but, for example, GitHub Action could add โŒ to originally โœ… commit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.