A personal card for Kiko Beats (@kikobeats)
kikobeats © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats
Get the screen aspect ratio of a device.
License: MIT License
A personal card for Kiko Beats (@kikobeats)
kikobeats © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats
Hi,
I'm currently writing an article on fluid images involving some aspect ratio computations.
Would it be possible to add cli
support so I can cite your module?
Something like this:
aspect-ratio 1920 1080
# => 16:9
aspect-ratio 1920 1080 --separator=/
# => 16/9
Thanks!
Branch | Build failing 🚨 |
---|---|
Dependency | mocha |
Current Version | 3.3.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.
This week's highlights:
allowUncaught
added to commandline as --allow-uncaught
(and bugfixed)--no-warnings
and --trace-warnings
flags (@sonicdoe)The new version differs by 9 commits0.
7554b31
Add Changelog for v3.4.0
9f7f7ed
Add --trace-warnings
flag
92561c8
Add --no-warnings
flag
ceee976
lint test/integration/fixtures/simple-reporter.js
dcfc094
Revert "use semistandard
directly"
93392dd
no special case for macOS running Karma locally
4d1d91d
--allow-uncaught cli option
fb1e083
fix allowUncaught in browser
4ed3fc5
Add license report and scan status
false
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Hello, I just found this to calculate the aspect ratio of images to makes sure a suer selects a 16x9 or a 9x16 for upload.
However, I noticed that this library always puts whatever is the heigher value as the first in the output?
Aka:
160x90 => 16:9
90x160 => 16:9
Which is not correct and isn't very useful? Why not keep the order on the final output? Is there a reason that I am not aware of?
I understand it may be necessary for the gcd
calculation, but not for the final output. I think there it makes more sense to use the initial height/width as they were input.
Running this code will cause a RangeError: Maximum call stack size exceeded
import * as aspectRatio from 'aspect-ratio'; console.log(aspectRatio(undefined, undefined));
Branch | Build failing 🚨 |
---|---|
Dependency | mocha |
Current Version | 3.5.3 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
You might want to read this before filing a new bug! 😝
For more info, please read this article.
node
from exiting will do so when run in Mocha. Supply the --exit
flag to revert to pre-v4.0.0 behavior (@ScottFreeCode, @boneskull)stdout:
prefix from browser reporter logs (@skeggse)--forbid-pending
or --forbid-only
is specified (@ScottFreeCode)--compilers
command-line option is now soft-deprecated and will emit a warning on STDERR
. Read this for more info and workarounds (@ScottFreeCode, @boneskull)The new version differs by 48 commits.
d69bf14
Release v4.0.0
171b9f9
pfix "prepublishOnly" potential portability problem
60e39d9
Update link to wiki (GitHub at the leading --
)
804f9d5
Update link because GitHub ate the leading --
3326c23
update CHANGELOG for v4.0.0 [ci skip]
6dd9252
add link to wiki on --compilers deprecation
96318e1
Deprecate --compilers
92beda9
drop bower support
58a4c6a
remove unused .npmignore
7af6611
kill Date#toISOString shim
43501a2
reduce noise about slow tests; make a few tests faster, etc.
fa228e9
update --exit / --no-exit integration test for new default behavior
3fdd3ff
Switch default from forced exit to no-exit
c5d69e0
add integration tests for --exit/--no-exit
3a7f8dc
enhance runMochaJSON() helper by returning the subprocess instance
There are 48 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.
Since we did not receive a CI status on the greenkeeper/initial
branch, we assume that you still need to configure it.
If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/
.
We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.
I tryed install this package using npm, but don't works.
I get this error:
$ npm install aspect-ratio --save
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "aspect-ratio" under a package
npm ERR! also called "aspect-ratio". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myuser\AppData\Roaming\npm-cache\_logs\2020-05-14T22_10_04_519Z-debug.log
Node Version: v12.16.1
NPM Version: 6.13.4
Branch | Build failing 🚨 |
---|---|
Dependency | mocha |
Current Version | 4.0.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 6 commits.
eb8bf8d
Release v4.0.1
3b485ea
update CHANGELOG.md for v4.0.1 [ci skip]
96e5c1a
upgrade eslint to v4.8.0
d7cff37
Update growl to 1.10.3
0cdd921
remove preversion script; test on publish; closes #2999
f49c0ce
Fix changelog issues/pr URLs (#3047)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
When I npm install --save aspect-ratio
, the module at index.js
doesn't show up. This is reproducible at https://npm.runkit.com/aspect-ratio. Without event writing any code and hitting "run" you'll see that it can't resolve the aspect-ratio
module.
I looked at your .npmignore
file and can't find anything suspicious but I can't imagine why your root file isn't being installed.
Lines 11 to 15 in 99b798d
Have been digging around trying to solve aspect ratio stuff on my end. Reading your code i noticed a few spots you could clean up. Not sure if this will require a transpile or anything, but just thought i'd share my 2 cents.
const gcd = (a, b) => b === 0 ? a : gcd(b, a % b)
const aspectRatio = (height, width, seperator=':')=> {
const [h1, w1] = height < width ? [width, height] : [height, width]
// or...
// const [h1, w1] = [Math.max(numerator, denominator), Math.min(numerator, denominator)]
const divisor = gcd(h1, w1)
return `${h1/divisor}${seperator}${w1/divisor}`
}
This removes any let
variables and gets rid of a bit of code for you. Also there is no mutation of the input variables (which is always a no-no). Feel free to use this or not, literally no change in behavior, just wanted to help a fellow open source author possibly learn another way to do things.
When I run a production build using webpack and UglifyJS, I get this error:
ERROR in main.613c420722787f3c86d7.js from UglifyJs
Unexpected token: operator (>) [./node_modules/aspect-ratio/index.js:6,0][main.613c420722787f3c86d7.js:116556,27]
😭
This is due to the fact that we're using arrow functions and UglifyJS is expecting plain old JavaScript. This means that we should be transpiling a browser version of this library to be used in these scenarios.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.