Git Product home page Git Product logo

bpre's People

Contributors

authrequest avatar azerpas avatar voidstar0 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpre's Issues

Migrate to TypeScript

By migrating each minified JS file to TypeScript, we might benefit from the type system.

Activate Visual Studio Code preview tooltip for bmak property

That would help a lot for debugging.

The ternary operator in this line https://github.com/char/bpre/blob/ff4f024cd2808b0e35afcdf9793ba56abe85260f/akamai/1.7.js#L5 is preventing the activation of VS Code preview function.

With the ternary operator

with

Without it

without

By removing the if then and just keeping the else, we could access the preview functionnality in the whole file.
@char what do you think? I could add a comment like you did here: https://github.com/char/bpre/blob/ff4f024cd2808b0e35afcdf9793ba56abe85260f/akamai/1.7.js#L247-L252

akamai: bmak.z1, bmak.d2, bmak.d2 / 6

What's Happening

bmak.start_ts is the starting timestamp of the script in milliseconds (Date.now)
bmak.y1 is defined as 2016
bmak.pi is an alias for parseInt

The bmak.z1 variable is assigned as follows:

bmak.z1 = bmak.pi(bmak.start_ts / (bmak.y1 * bmak.y1));

and can be rewritten as:

// 2016 * 2016 = 4064256
bmak.z1 = parseInt(bmak.start_ts / (2016 * 2016));

In a seperate function (bmak.bd), bmak.z1 is divided by 23 and assigned to bmak.d2:

bmak.d2 = bmak.pi(bmak.z1 / 23);

Finally, while sensor data is being crafted in bmak.bpd, bmak.d2 is being divided by 6.

f = bmak.pi(bmak.d2 / 6)

Questions

  • What is the significance of dividing the start timestamp by 4064256
  • What is the significance of dividing the result of that by 23
  • What is the significance of dividing the result of that by 6

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.