Giter VIP home page Giter VIP logo

lib-v2's Introduction

This repo contains the libraries I use

Most of them are mine, but some will be libraries of other people

Not because I'm a fiend for stealing, but because it's simply easier for me to manage

People to check out for cool libraries:

Dependencies

The libraries will generally list all of their dependencies at the top by

#Include <this-library>

All the libraries I use will be in this repository, so you can technically use any / all of my / not my libraries

lib-v2's People

Contributors

animan8000 avatar axlefublr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lib-v2's Issues

Infos throw error because of 'unset'

When script is started, there is an initial error for all 3 unset parameters. The script works fine if the errors are ignored. When restarted - happens again:
image

I had a struggle with importing your libraries

Hey, I'm very thankful for your open scripts. However, i had a hard time realising how to actually use them.
You are using #include <...>, which i didn't know of. I spent half an hour realising that i should rename the folder 'lib-v2' to just 'lib', so that ahk could understand that those are all libraries.
So what i am suggesting is to add in the readme something like "rename the folder to 'lib' for all includes to work". I hope this will help someone not spending time on handling an error "script library not found"
cheers!

Json oriented timers

As of now, Tools/Timer.ahk works like this:

Set a timer, if you reload the script while that timer is still on, it will be forgotten

So because of this, you need to have a separate ahk script that you won't reload so the timer stays, even if you reload your main script

How I want this to work:

Each time you create a new timer, the class adds the information about it to a json file

The most important information is the YYYYMMDDHH24MISS format of when the timer will have to end, and the time it started at

Every time a timer runs out, its entry in the json file is deleted as well

The reason for this approach:

I want to have a static method of the class that checks that json file for any timers

If there are any, it starts waiting for them.

A long ass -time timer might be the correct way to go, but it's not tested yet how stable that approach is

If there aren't any, it just fucks off

And you're supposed to call this method somewhere in your script

You could just have this call in the static __Init() method of the class, but that feels a bit too intrusionary, still, pretty good idea nevertheless

Create initializers for classes

Create a file "Extensions/Initializable.ahk" with a class that implements an initializer

The initializer takes an object of key, value pairs, checks whether the class has those keys (meaning, properties) by using .HasProp()

If those properties exist, it sets them to the values provided in the object, otherwise throws an error

The way to use this class will be by inhertance. Any class that wants to be able to be initialized, will be extending the Initializable class (which would be an interface if those existed in ahk)

Utils/Win.ahk will use this functionality instead of a free for all, where you could set anything in the initializer, even if that property didn't exist to begin with

Json oriented stopwatch

How it currently works:

You set a stopwatch once, and can never really stop it

Only restart it and see how much time has passed

This is not perfect:

because sometimes you want to track the time it takes to complete some task, but you could be taking pauses while doing that task

That means that you would have to start your stopwatch, check how much time has passed once you wanna take a break and write that down

Then when you're done with your break, you'll just start the stopwatch again

This would be great already, if you didn't have to write down the time

How this should work now:

The first time you start a stopwatch, it writes the time it started at into a json file

If you pause a stopwatch, it writes the difference between that starting time and A_Now, so now there's a json property that has the time that has passed since starting to the pause

You unpause your timer by specifically using an Unpause method, that doesn't overwrite the time that has passed overall, but does overwrite the time it started at (to be able to do the math we need)

Since the collectedTime property is not empty, the stopwatch keeps adding time to that property through TimeAdd (or DateAdd, don't remember)

Once you get the passed time for the last time and decide to start a new stopwatch, you use the Start method, which differs from Unpause only by overwriting the json collectedTime property with nothing

The class should support multiple stopwatch objects (so not static anymore)

I'll have to think whether I need multiple ever, or rather how I'm going to express that with a hotkey

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.