Profile cover photo
Profile photo
Jan Amoyo
94 followers -
aspiring internet hunk
aspiring internet hunk

94 followers
About
Jan's posts

Post has attachment
Upserting Items into DynamoDB
When updating documents, MongoDB has a useful feature to insert a new document when no document matches the query criteria. This feature is called an upsert . Sadly, as of this writing, DynamoDB misses on this feature out of the box. Thankfully, there's a w...

Post has attachment
Using LocalStorage to Publish Messages Across Browser Windows
Below is a simple JavaScript utility for publishing messages across different browser windows of the same domain . This implementation uses the browser's localStorage and the storage event to simulate the behavior of a topic. (function (global, window) {
...

Post has attachment
Increasing ngRepeat Limit on Scroll
The example below shows how to increase the limitTo filter of ngRepeat everytime the div scrollbar reaches the bottom. First, we create a directive that calls a function whenever the div scrollbar reaches the bottom: module.exports = function (_module) {
...

Post has attachment
Animated Photo

Post has attachment
Changing Tab Focus Behavior Using Angular
The example below uses 2 Angular directives to change the focus behavior when pressing tab. The first directive is used to assign a name to a 'focusable' element. module.exports = function (_module) {
_module.directive('focusName', function () {
retur...

Post has attachment
Testing Angular Directives with Templates on Karma and Browserify
Directives are the cornerstone of every Angular application. And templates help keep their behavior separate from the presentation. Karma works well with Angular and is an essential tool for running tests against a number of supported browsers. Lastly, Brow...

Post has attachment
Examples of Streams and Lamdas in Java 8
Below is a code showcasing Streams and Lamdas in Java 8 (written as a JUnit test allow execution of individual methods). @RunWith(BlockJUnit4ClassRunner.class)
public class Java8Showcase {

@FunctionalInterface
public static interface Concat {
Strin...

Post has attachment
MongoDB Transaction Across Multiple Documents using Async and Mongoose
Unlike traditional databases, MongoDB does not support transactions . So suppose you have multiple documents and want to perform a "save all or nothing" operation, you'd have to simulate a transaction from within your application. Implementing such a transa...

Post has attachment

Post has attachment
Generating Unique and Readable IDs in Node.js Using MongoDB
I had a requirement from an upcoming project to generate unique human-readable IDs. This project is written in Node.js and uses MongoDB for its database. Ideally, I can use an auto-incrementing Sequence to achieve this. However, unlike most relational datab...
Wait while more posts are being loaded