Next biggest number with same digits function perm(xs) { let ret = []; for (let i = 0; i < xs.length; i = i + 1) { let rest = perm(xs.slice(0, i).concat(xs.slice(i + 1))); if(!rest.length) { ret.push([xs[i]]) } else { for(let j = 0; j < rest.length; j = j + 1) { ret.push([xs[i]].concat(rest[j])) } … Continue reading CodeWars solutions
I Learn Smarter – Privacy Policy
Google Play allow developers to set a privacy policy page. This policy is very short as my intent is to create as stateless applications as possible I Learn Smarter mobile apps: don't require Internet connectiondon't display addsonly store data for the latest database index in order to allow the users to keep their progressdon't need … Continue reading I Learn Smarter – Privacy Policy
R.lt – are we that lazy?
I was browsing an old code of mine when I saw this line const removeShortSentences = R.compose( R.lt(3), R.length, R.split(".") ) I was surprised by how unreadable the piece with R.lt is, as all it does is to save a few characters. The same logic without R.lt has much clearer intent: const removeShortSentences = R.compose( … Continue reading R.lt – are we that lazy?
CMS.js and other useful Javascript libraries
HTML partials plugin for Webpack It allows easy way to include GoogleAnalytics code inside the Webpack bundle. CMS.js It allows creation of documentation site for Github repos using Github pages. I use docsify for Rambda and Rambdax projects, but this library could eventually replace it if it is as good as advertised. Why did you … Continue reading CMS.js and other useful Javascript libraries
R.partition – extended version of R.filter
R.partition The method is similar to R.filter, but it instead of returning single list with all list members passing the predicate function, it return two lists. First list is the same as the result of R.filter, i.e. all instances of the list passing the predicate. The second list holds all list members that doesn't pass … Continue reading R.partition – extended version of R.filter
Collection of Javascript news for December 2018
Electron Electron is now with major version bump to 4.0.0 with lots of nice things. The Electron startup repos are still with 3.* versions but we are big boys, we should be able to install it and without those. Autocomplete Autocomplete library is also getting in the news because of major bump. The library is … Continue reading Collection of Javascript news for December 2018
Using assisted generation of commit messages
It is fairly easy to overestimate the value of having a pattern when writing the commit messages. But if you work in a large project(as you should), you will realize that it is important to have stricter rules in this regard. Commit message libraries CommitlintCommitizenCommit-message While the first two are popular and widely used, I … Continue reading Using assisted generation of commit messages
Rambdax.isValid usage in unit tests
R.isValid is a method that accepts input and schema and returns a boolean result.The result is true if the input is passing the schema.The methods R.ok , R.pass , R.isAttach are using R.isValid and thus providing different interfaces for access to the validation logic.I have the following use case while testing I Learn Smarter code, … Continue reading Rambdax.isValid usage in unit tests
Spread string to create an array
Taken from https://v8.dev/blog/spread-elements const str = 'こんにちは'; const result = [...str];// → ['こ', 'ん', 'に', 'ち', 'は'] This means that we don't need to do splitting of string in order to create an array with its characters as we did before. So the following code situation can now be escaped: const str = 'foo' const … Continue reading Spread string to create an array
Rambdax pending methods
Usually new methods in Rambdax comes from actual use case, so once these methods are published, they have a destination. Such examples are R.glue, R.change and R.remove. But there are those other methods that start their life just because the logic is there. Their initial use-case is quite narrow and this could lead later to … Continue reading Rambdax pending methods





