Skip to content

Instantly share code, notes, and snippets.

@ahandsel
Last active April 5, 2022 07:46
Show Gist options
  • Select an option

  • Save ahandsel/a43600b9227583fc03a167539e4df2a1 to your computer and use it in GitHub Desktop.

Select an option

Save ahandsel/a43600b9227583fc03a167539e4df2a1 to your computer and use it in GitHub Desktop.

No Server Data Visualization: Build a Word Cloud Project!

Thank you for attending our Kintone x Word Cloud workshop!

Use the following CSV, JavaScript, & PDF files and CDN URLs for the hands-on section!

Download Links

Click here or the Download Zip button on the upper right corner for all the code, data, & slide you need for our workshop!

Getting your FREE Kintone Database

Step 1 - Sign Up for Kintone Developer Account (Website)

  • bit.ly/KDP_signup
    • ⚠ Do NOT use Safari
    • ⚡Accept Cookies First
    • ✅ Use Chrome & Firefox

Step 2 - Create a Kintone Subdomain (Environment)

  • bit.ly/K_DevLic
    • ⚡ Only use lowercase, numbers, & hyphens in your subdomain
    • ⚠ Do not use uppercase nor special characters

References

The Word Cloud graphic was generated using the following dev.to articles' content:)

Article Title Written By Link Content
22 Miraculous Tools for React Developers in 2019 jsmanifest https://dev.to/jsmanifest/22-miraculous-tools-for-react-developers-in-2019-4i46 Find me on medium (Edit: Read the comments to find my comment about a good modern program for programmers that I use every day to take notes with that supports syntax like React/JSX, made with react. I wish I can come back to include it in here, but It's too late) React, as we know it, is a JavaScript library to build amazing user interfaces. But not everybody is using the same tools or know all of the great ones out there that help make the react development experience funner and more proactive. If you haven't used react yet or have friends that might be interested in using it, what do you say when they ask you why they should use the library? Besides telling them how great the library is (which should be the first thing), I also like to mention that the tools created by the open source community helps bring the experience to a whole new level of excitement. Here are 22 tools you can use to build your react apps in 2019 (This list is not in order of their importance) 1. webpack-bundle-analyzer Ever wondered which packages or parts of your app is taking up all the space? Well, you can find out if you use the webpack-bundle-analyzer. This package will help you identify output files that take up the most space. It will create a live server and present to you an interactive treemap visualization of the contents of your bundles. With this in your toolkit, you're able to see where the presented files are located, their gzip size, parsed size, and their belonging parents/children. The benefits? Well, you can optimize your react app based on what you see! Here is a screenshot of what this looks like: webpack_bundle_analyzer1 You can clearly see that the pdf packages take up the most space in the app. But it also takes the most space on the screen. That's very useful. However, the screenshot is very minimal. You can also pass in useful options to see more in detail like generateStatsFile: true and also choose to generate a static HTML file that you can save somewhere outside of your development environment for later use. 2. react-proto react-proto is a prototyping tool for developers and designers. It's a desktop software, so you'd have to download and install the software before using. Here's an example of this software in use: react_proto_1 The app lets you declare props and their types, view your components in a tree, import a background image, define them as stateful or stateless, who their parent components will be, zoom in/out, and export your prototype into a new or existing project. The app seems more tailored for mac users however, but it still works fine for windows users. After you're done mapping out your user interfaces you can choose to export to either an existing project or a new project. If you choose to export to an existing project and choose your root directory, it will export them to ./src/components like this: react_proto_2 And here is an example of one of the components we had in the example: react_proto_3 react-proto acquired over 2,000 stars on GitHub. Personally though I think this app needs an update and more work especially with the release of react hooks. It also doesn't zoom out unless you have a background image visible. In other words, if you import a background image, zoom out, then proceed to delete the background image, you won't be able to zoom back in because the buttons are greyed out. The only way to zoom back in is to import the background image back in, then removing it after you zoom back in. That flaw changed my views about this app, but it makes it to this list because we don't see this open sourced anywhere else. And being open sourced is the good thing about this app which potentially makes it possible to make the trending open sourced repositories list in the future (Their features are important, but they seem to be lacking manpower). 3. why-did-you-update why-did-you-update monkey patches React to notify you about avoidable re-renders. This is incredibly useful not only in guiding you to performance fixes for your projects, but also to help you understand the way react works. And when you have a more understanding of how react works, this makes you a better react developer. You can attach a listener to any custom component by declaring an extra static property whyDidYouRender with its value to true: import React from 'react' import Button from '@material-ui/core/Button' const Child = (props) => <div {...props} /> const Child2 = ({ children, ...props }) => ( <div {...props}> {children} <Child /> </div> ) Child2.whyDidYouRender = true const App = () => { const [state, setState] = React.useState({}) return ( <div> <Child>{JSON.stringify(state, null, 2)}</Child> <div> <Button type="button" onClick={() => setState({ hello: 'hi' })}> Submit </Button> </div> <Child2>Child #2</Child2> </div> ) } export default App Only after doing so will your console be put on blast with incredibly annoying warnings: why_did_you_render1 But don't take it the wrong way. Take it as a good thing. Leverage those annoying messages so you can fix those wasteful rerenders, and those annoying messages will finally leave you alone! 4. create-react-app Everybody knows that create-react-app is the quickest way to start developing a react project (with modern features included out of the box). What could possibly be easier than npx create-react-app <name>? All of my tutorials on medium (along with dev.to) are building react interfaces with create-react-app, simply because its just quick and easy. What some of us might not know is how to create a typescript project using CRA. All you have to do is is add --typescript at the end: npx create-react-app <name> --typescript That will save you the trouble of manually adding typescript to your CRA projects. 5. react-lifecycle-visualizer react-lifecycle-visualizer is an npm package for tracing & visualizing lifecycle methods of arbitrary React components. Similar to why-did-you-render, you can enable any component(s) of your choice to bring out the lifecycle visualizer: import React from 'react' import { Log, VisualizerProvider, traceLifecycle, } from 'react-lifecycle-visualizer' class TracedComponent extends React.Component { state = { loaded: false, } componentDidMount() { this.props.onMount() } render() { return <h2>Traced Component</h2> } } const EnhancedTracedComponent = traceLifecycle(TracedComponent) const App = () => ( <VisualizerProvider> <EnhancedTracedComponent /> <Log /> </VisualizerProvider> ) This will present the visualizer as shown below: react_lifecycle_visualizer However, one downside to this is that it currently only works for class components, so hooks aren't yet supported. (The question is can they be, since this is about life cycles?) 6. Guppy Guppy is a friendly, free, application manager and task runner for React that runs on the desktop. They seem to prioritize those who are newer to developing in react. However it might also be useful for advanced developers. It provides a friendly graphical user interface for many typical tasks that react developers face on a regular basis such as creating new projects, executing tasks and managing dependencies. Windows support was added in August of 2018, so you can be assured that it's cross-platform. Here's how guppy looks like: guppy1 7. react-testing-library I've always loved react-testing-library because it just feels right when writing your unit tests. This package provides react DOM testing utilities that encourage good testing practices. This solution aims to solve the problem of testing your implementation details and instead test the input/output of your react components just as the user would see. Testing implementation details is not an effective way of ensuring that your app works as expected. Sure, you'll be able to have more confidence on how you're getting the data your components need, which sort method to use, etc. but if you have to change the way you implemented that to point to a different database then your unit tests would fail because those are implementation details which are coupled logic. That's an issue on what react-testing-library solves, because ideally you just want your user interface to work and be presented correctly in the end. How to get data to those components doesn't really matter as long as they still give the expected output. Here's an example code of how you would place tests using this library: // Hoist helper functions (but not vars) to reuse between test cases const renderComponent = ({ count }) => render( <StateMock state={{ count }}> <StatefulCounter /> </StateMock>, ) it('renders initial count', async () => { // Render new instance in every test to prevent leaking state const { getByText } = renderComponent({ count: 5 }) await waitForElement(() => getByText(/clicked 5 times/i)) }) it('increments count', async () => { // Render new instance in every test to prevent leaking state const { getByText } = renderComponent({ count: 5 }) fireEvent.click(getByText('+1')) await waitForElement(() => getByText(/clicked 6 times/i)) }) 8. React Developer Tools React developer tools is an extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools. This is the most commonly known in this list and continues to be one of the most helpful tools react developers can use to debug their apps. 9. Bit A good alternative to using component libraries like material-ui or semantic-ui-react is Bit. This lets you explore thousands of open sourced components and lets you use them to build your projects. bit There are so many different available react components that are up for anybody to use including tabs, buttons, charts, tables, navbars, dropdowns, loading spinners, date pickers, breadcrumbs, icons, layouts, etc. These get uploaded by other react developers just like you and I. But there's also useful utilities available as well like formatting distances between dates. 10. Storybook If you don't know about storybook yet, I highly recommend you to start using them if you want an easier experience building UI components. This tool starts up a live development server with hot reloading supported out of the box where you can develop your react components real-time in isolation. Another great thing about this is that you can use current existing addons that are open sourced to bring your development experience to a whole new level. For example, with the storybook-readme package you can create readme documentations while developing the react components for production use right on the same page. This is sufficient to serve as normal documentation pages would: storybook1 11. React Sight Have you ever wondered what your app may look like in a flow chart? Well, react-sight lets you visualize your react apps by presenting to you a live component hiearachy tree of your entire app. It also supports react router, redux, as well as react fiber. With this tool you hover over nodes which are the links to components that directly relate to them in the tree. If you're having trouble seeing results, you may want to type in chrome:extensions on your address bar, look for the react-sight box and click the Allow access to file URLs switch, as shown below: react-sight1 12. react-cosmos react-cosmos is a development tool for creating reusable react components. It scans your project for components and enables you to: Render components under any combination of props, context and state Mock every external dependency (eg. API responses, localStorage, etc) See app state evolve in real-time while interacting with running instances 13. CodeSandbox This is hands down one of the best tools available out there to get your hands dirty with react faster than the speed of an eye blink (Ok, maybe not that fast). This tool called CodeSandbox is an online editor that lets you create web applications from prototype to deployment--all from the website! Codesandbox originally only supported React at the earlier stages but they've now expanded to additional starter templates for libraries like Vue and Angular. They also support kickstarting your next react web project by creating projects with common static site generators like gatsby or nextjs. There is so many great things to talk about when it comes to codesandbox. For one, it's incredibly active. If you need to explore some projects that people are building at your convenience, it's easy to click explore and get access to a bunch of code examples to help renovate your next project: codesandbox1 Once you start editing inside a project you'll begin to realize that what you're about to be using is actually the VSCode editor which is powerful. I'd love to write a whole article about all of the features you can do at codesandbox today, but it seems like the work has already been done. 14. React Bits React bits is a collections of react patterns, techniques, tips and tricks all written in an online document-like format where you can quickly access different design patterns and techniques, anti-patterns, styling, UX variations and other helpful react related material all on the same tab. They have a GitHub repo currently at 9,923 stars. Some examples include concepts like props proxying, composition to handle various UX in different scenarios, and even exposes some gotchas that every react developer should be aware of. Here is what it looks like to be on their page, as you can see on the side menu to the left there's plenty of information :) react-bits1 15. Folderize Folderize is a VSCode extension that was released less than 7 days ago. It lets you turn a component file into a component folder structure. Your react component will still be a component, it's just converted into a directory now. For example, lets say you were creating a react component that takes some file as props to display some useful information like their meta data. The logic for the meta data component is taking up plenty of lines so you decide to split this up into a separate file. But when you decide to do that, now you have two files that relate to eachother. So if you have a directory that looks like this: folderize1 You might want to abstract out the FileView.js and FileMetadata.js into a directory structure just like how Apples is--especially if you're thinking to add more components related to files like FileScanner.js. That's what folderize does for you so that they can come out to a structure similar to this: folderize2 import React from 'react' import FileView from './src/components/FileView' const App = (props) => <FileView {...props} /> export default App 16. React Starter Projects Here is a great list of react starter projects that you can see all in one page. So if you're the type of person that finds it quick and useful to be presented with a huge list of options to choose from at the same time, then this one's for you. Once you see a starter project you like, you can simply just clone the repository and make your own modifications tailored to your upcoming app. However not all of them is intended to be used by cloning the repository because some of them are to be installed instead, which becomes a depdency of your project. This makes it easier to get updates and keep your project cleaner. Here is what the page looks like: react starter projects1 17. Highlight Updates This is arguably the most important tool anybody could ever have in their development toolkit. This is a feature of the react devtools extension and makes it possible to see which components in your pages are re-rendering unnecessarily: react render lines It helps you spot bottlenecks while developing your pages and makes it even easier when they colorize severe re-rendering issues with orange / red. Unless you're aiming to build a mediocre app, why would you not want this beautiful thing next to you? 18. React Diff Viewer react-diff-viewer is a simple and beautiful text diff viewer made with Diff and React. This supports features like split view, inline view, word diff, line highlight, etc. This can be useful if you were trying to embed this feature into your notes (Ahem Boostnote) and customize it to be more tailored for your app (theme colors, documentation combination with storybook presentations, etc) react-diff-viewer 19. js.coach The site I use the most to look for react related material is js.coach. Now i'm not sure why I don't see very many mentions of this gem, but i've found just about anything I needed from this page alone. It's quick, easy, constantly updated and never fails to give me the results I need for all of my projects. They recently added the React VR tab which is wonderful! 20. awesome-react The GitHub awesome-react open sourced repository is a list of awesome things related to react. I can probably not know that other websites exist and just learn react only from this link alone. You'll find batches of useful resources that will surely help you build great react apps! 21. proton-native proton-native gives you a react environment to build cross platform native desktop apps. It's an alternative to Electron and has some neat features including: Same syntax as React Native Works with existing React libraries such as Redux Cross platform Native components. No more Electron Compatible with all normal Node.js packages Interested in learning more? Read their documentation. 22. Devhints React.js Cheatsheet A pretty good cheatsheet for react, although it is missing react hooks. No worries, I will be creating a cheat sheet for reactv16.8+ so stay tuned for that. Conclusion And that concludes the end of this post! I hope you have found valuable information here and look out for more from me in the future!
My favorite CSS hack Gajus Kuizinas https://dev.to/gajus/my-favorite-css-hack-32g3 There is one CSS snippet that I have been copy-pasting for 5 years: * { background-color: rgba(255,0,0,.2); } * * { background-color: rgba(0,255,0,.2); } * * * { background-color: rgba(0,0,255,.2); } * * * * { background-color: rgba(255,0,255,.2); } * * * * * { background-color: rgba(0,255,255,.2); } * * * * * * { background-color: rgba(255,255,0,.2); } * * * * * * * { background-color: rgba(255,0,0,.2); } * * * * * * * * { background-color: rgba(0,255,0,.2); } * * * * * * * * * { background-color: rgba(0,0,255,.2); } ^ This is one of my favourite inventions. I first shared it on Quora in 2014 (What are the most interesting HTML/JS/DOM/CSS hacks that most web developers don't know about?) and I still get notifications of someone upvoting this answer daily. But what does this horrible thing do? It is meant to be used when you are working with layout, e.g. Without CSS hack The problem is that unless the element on the page has a solid background or it is a picture, you do not see how does it fit into the layout, e.g. most of the text nodes, pictures with transparency, etc. With the above CSS applied you will see something along the lines of: With CSS hack Different depth of nodes will use different colour allowing you to see the size of each element on the page, their margin and their padding. Now you can easily identify inconsistencies.
✨♻️ JavaScript Visualized: Event Loop Lydia Hallie https://dev.to/lydiahallie/javascript-visualized-event-loop-3dif JavaScript Visualized (7 Part Series) Oh boi the event loop. It's one of those things that every JavaScript developer has to deal with in one way or another, but it can be a bit confusing to understand at first. I'm a visual learner so I thought I'd try to help you by explaining it in a visual way through low-res gifs because it's 2019 and gifs are somehow still pixelated and blurry. But first, what is the event loop and why should you care? JavaScript is single-threaded: only one task can run at a time. Usually that's no big deal, but now imagine you're running a task which takes 30 seconds.. Ya.. During that task we're waiting for 30 seconds before anything else can happen (JavaScript runs on the browser's main thread by default, so the entire UI is stuck) 😬 It's 2019, no one wants a slow, unresponsive website. Luckily, the browser gives us some features that the JavaScript engine itself doesn't provide: a Web API. This includes the DOM API, setTimeout, HTTP requests, and so on. This can help us create some async, non-blocking behavior 🚀 When we invoke a function, it gets added to something called the call stack. The call stack is part of the JS engine, this isn't browser specific. It's a stack, meaning that it's first in, last out (think of a pile of pancakes). When a function returns a value, it gets popped off the stack 👋 The respond function returns a setTimeout function. The setTimeout is provided to us by the Web API: it lets us delay tasks without blocking the main thread. The callback function that we passed to the setTimeout function, the arrow function () => { return 'Hey' } gets added to the Web API. In the meantime, the setTimeout function and the respond function get popped off the stack, they both returned their values! In the Web API, a timer runs for as long as the second argument we passed to it, 1000ms. The callback doesn't immediately get added to the call stack, instead it's passed to something called the queue. This can be a confusing part: it doesn't mean that the callback function gets added to the callstack(thus returns a value) after 1000ms! It simply gets added to the queue after 1000ms. But it's a queue, the function has got to wait for its turn! Now this is the part we've all been waiting for… Time for the event loop to do its only task: connecting the queue with the call stack! If the call stack is empty, so if all previously invoked functions have returned their values and have been popped off the stack, the first item in the queue gets added to the call stack. In this case, no other functions were invoked, meaning that the call stack was empty by the time the callback function was the first item in the queue. The callback is added to the call stack, gets invoked, and returns a value, and gets popped off the stack. Reading an article is fun, but you'll only get entirely comfortable with this by actually working with it over and over. Try to figure out what gets logged to the console if we run the following: const foo = () => console.log("First"); const bar = () => setTimeout(() => console.log("Second"), 500); const baz = () => console.log("Third"); bar(); foo(); baz(); Got it? Let's quickly take a look at what's happening when we're running this code in a browser: We invoke bar. bar returns a setTimeout function. The callback we passed to setTimeout gets added to the Web API, the setTimeout function and bar get popped off the callstack. The timer runs, in the meantime foo gets invoked and logs First. foo returns (undefined),baz gets invoked, and the callback gets added to the queue. baz logs Third. The event loop sees the callstack is empty after baz returned, after which the callback gets added to the call stack. The callback logs Second. Hope that this makes you feel a bit more comfortable with the event loop! Don't worry if it still seems confusing, the most important thing is to understand where certain errors/behavior can come from in order to Google the right terms efficiently and end up on the correct Stack Overflow page 💪🏼 Feel free to reach out to me if you have any questions!
10 Great Programming Projects to Improve Your Resume and Learn to Program SeattleDataGuy https://dev.to/seattledataguy/10-great-programming-projects-to-improve-your-resume-and-learn-to-program-1e2h One of the common questions we get when it comes to learning how to program, is: "What are some good ideas for projects to build?" Now, we hear the common cliche answers often, like "build a chess game" or "command line interface". There is nothing wrong with these answers. However, we think these examples don't match modern programming needs. A big portion of modern software is SaaS and web apps. This means you need to know how to program online. There are a lot more complexities that go into programming a website, or app, that has users, requires servers, authentication, and databases. This forces you to interact with technologies you'll never need when developing a command line tic-tac-toe game. Some of this can also be managed by AWS and other third parties that are commonly used by large corporations. Again, exposing you to technologies that are useful and heavily used in industry. This will be far more practical on a resume, as well as help you learn how to use new technologies. Tip: If you pick a complex project, then focus on building one feature at a time. Building an entire website or app all at once is difficult. Start by building a login page, or maybe the main landing page after the user logs in. If you try to take on the whole project at once then you will likely fail. Entertainment 1. A web scraper that posts top 10 blogs without human intervention One of the issues we find with some project recommendation posts, is that they recommend projects that aren't implemented in a way that excites the programmer to continue development. For instance, I see that a lot of people recommend building a web scraper. Once you've built that web scraper and scraped the data, what are you going to do with it? Instead of just scraping the data, why not build a website with that data. It doesn't have to be fancy or get a lot of views. This scraper could pull the data into a database and then select the most popular posts. From there it could copy the title, along with a few sentences, and then create a post that it shares online. This would be an impressive and simple project that you can actually show off. You've now shown that you can do more than just code a small segment of a system. Instead, you can think through an entire system. You need to consider how you are going to automate the process, manage the database, create the website and select the posts. This also allows you to actually have a tangible end product. Without a tangible end product, it's really easy to become unmotivated and simply stop at only a web scraper. In addition, you never know, maybe your site will become popular! Skills: Database, web scraper, automation, web development (for the blog), and general programming. 2. An event-alert system using Meetup and Eventbrite APIs Have you ever wanted to go to a band or comedian show, but realized it was last week? Maybe there was a free conference in your area on data science or big data and you missed out because you forgot to check. Why not make your own aggregator using the Meetup and Eventbrite APIs, that will warn you when keywords are in event descriptions or titles? Now, I assume both Meetup and Eventbrite have similar options. But it is always fun to try to build your own system. You can customize the system to work the way you want, and maybe even allow other people to make their own alerts by making this a website. What we enjoy about this project is that you can practice working with two different APIs. This will allow you to compare and contract what you like and dislike about them. That way, if you're ever in charge of building an API, you'll have a better picture of what works and what doesn't. Skills: APIs, database, automation, web development, and general programming. 3. A 9GAG copy cat You don't always need to try to reinvent the wheel when creating your own projects. Simple projects like a site that lets you login, post photos, GIFs, and lets you scroll through a feed, provides an opportunity to create a solid base site first. Then you can add lots of interesting features like following, liking, and search. Search in particular would be a great chance to learn how recommendation systems and machine learning work! It's always fun to try and replicate popular sites. In fact, it is actually a great way to learn because you have to reverse-engineer each feature. Reverse engineering is a great skill, because as a software engineer you will constantly be maintaining other people's code and you will need to get in their heads. Skills: Machine learning (for recommendation system), database, automation, web development, and general programming. Retail Type Sites 4. A gift recommendation app Have you ever struggled to find the right gift for your friend? What if you could create a website that helps to predict what to buy a friend for a gift. It could allow the end user to either create an account or just get a gift recommendation. Again, this allows for the opportunity to create an account which requires authentication, database development, etc. Also, another great part about this project is you can use Amazon's API for affiliate links. This will allow you to do a few things. One, learn about how to use APIs and get you comfortable with reading API documentation. Two, if you do it well, you can get a commission for each product someone buys. This project also has an opportunity to try to create a basic machine learning model. You can create a quiz of sorts that tries to figure out what the best gift is and then, based on if people click the gift or not, can drive the model to learn based on the response rate. Skills: APIs, database, general programming, and app development. 5. A site for bartering and trading Think OfferUp, but instead of money, why not create a website that only allows trades. This concept will force you to develop several features that need some thought. You won't be able to just attack this project without a plan. How will people post, where will people find recently posted items and how will people search. All of these are separate features you can build. In addition, you need to think how users will interact, and maybe even how they actually make the trade. The idea doesn't have to be 100% practical for real life — it needs to be practical in the sense of improving your skill set as a programmer. Skills: Database, web development, general programming, and app development (if you choose to make it an app). B2B 6. Invoice and contract management system Contract and invoice management are very complex processes. Contracts can have a lot of nuanced clauses and stipulations that can be difficult to track. This makes this a very good project, even if you simplify it to some of its core components. Having to translate a complex business process into software is not easy. But it is what makes this project a good challenge. Again, we wouldn't overcomplicate this. Take a basic feature, like inputting the terms of a contract, and develop this part first. Then you can add other features like invoice tracking, contract analytics and forecasting. Skills: Process management, database, web development, and general programming. 7. Task management system Task boards like KanbanFlow are built with several modular features that make it a great project to play around with. It will take a little work to get started, as you will need to set up a UI that is robust and dynamic as well. In fact, this project would be more of a two person job. One person to work on the front end and another person to work on the back end. Don't let that discourage you! This is actually a chance for you to work on your communication and team work skills. You will need to talk through designs to make sure you both fully understand it, and you know where your modules will be connecting. This is always more challenging than it seems. Skills: Communication, front end, database, web development, and general programming. 8. A job board Any project that forces you to allow users to input as various types of users adds an interesting design aspect. How will you ensure that the way employers experience the site meets their needs vs. prospecting job searchers? Like most of the other projects, you don't need to focus on all of it at once. Start out by trying to create the ability to create a job posting first. Then you can go and focus on the job searchers and how they respond. Skills: Database, web development, and general programming. 9. A website that forecasts profits based on standardized data sets There are a lot of data sets that are very standardized for most companies. This includes accounting data which is usually based on cost centers, accounts, line descriptions, and finally the actual transaction cost. What is great about the standardization of any data set, is that it makes it easy to create analytics on top of said data sets. Why not create a standardized dashboard that can help companies predict spend, see monthly outgoings, and possibly help them improve their spending. For this project you will probably have to spend a lot of time learning about how to make sure you keep your data secure. Of course, we recommend first trying to build the modules that focus on uptaking and standardizing the data and displaying it, before you go too deep into security. That's a rabbit hole you may never escape! Skills: Forecasting, business logic, database, web development, and general programming Game Ideas 10. Snake If you had a cellphone in the early 2000s, you've probably played Snake. It's a simple game but you can always try to make things more complex! First, start by just trying to make the game. This will require you to figure out how to develop a game online. This neon Snake by Sebastian Opperman is a great place to start. But after that, maybe you can add some cool new features like special items or special powers. This would be a chance to play around and have fun. This project won't be as technical from the stand point of having lots of users that sign up and use your site. However, it is a good challenge to figure out how to make a game run online. Skills: Web development, general programming, and UI We do hope this list inspires you to create an awesome new project that you can add to your resume and talk about in interviews. Maybe we'll see you as the next CEO of a billion dollar startup! Are You Interested In Learning About Data Science Or Tech? Learning Data Science: Our Favorite Data Science Books Our Favorite Machine Learning Courses On Coursera For Free How Algorithms Can Become Unethical and Biased How To Load Multiple Files With SQL How To Develop Robust Algorithms Dynamically Bulk Inserting CSV Data Into A SQL Server 4 Must Have Skills For Data Scientists SQL Best Practices — Designing An ETL Video
50+ free tools and resources to create awesome user interfaces Davide Pacilio https://dev.to/davidepacilio/50-free-tools-and-resources-to-create-awesome-user-interfaces-1c1b 'You're only as good as the tools you use' This saying has been around for years and highlights the importance of using the correct tool for the job. This motto applies to hundreds of different fields and disciplines, and luckily for us, to the design too. From my experience as a senior product designer, there is almost nothing more important than the correct tools to create a nice user interface. The right set of pictures or a well-balanced colour palette can make a huge difference between a poor and decent UI. I'm going to share a list of free and very useful resources/tools that I use daily to create users interfaces (websites, landing pages, web applications, etc…) for my clients, and for my projects Cruip and SaaS Landing Page. To allow you to easily find a specific set of resources/tools, I divided the list into different categories: Photos & Videos Illustrations Palette Typography Animations & Effects Iconography Patterns & Shapes Utility So if you're looking for a free set of icons, just jump to the iconography category. A final note: This list doesn't include some of the most popular resources to create user interfaces like Unsplash (for the Photos & Videos category), or Google Fonts (for the Typography one). Why? You probably already know them. 50+ free tools and resources to create amazing UIs: Photos & Videos Coverr Coverr Beautiful, free videos for your homepage background. Mixkit Mixkit Awesome stock video clips, stock music & premiere pro templates all completely free! Pexels Pexels The best free stock photos & videos shared by talented creators. Photo Creator Photo Creator Create realistic stock photos from thousands of models, objects, and backgrounds. Unscreen Unscreen Remove video and GIF backgrounds 100% automatically. Remove Background Remove Background Remove the background of any image 100% automatically. Generated Photos Generated Photos The most practical way to get high-quality generated faces for commercial content. Duotone Duotone Convert any photo to a duotone in seconds. Illustrations Open Peeps Open Peeps 100% free hand-drawn illustration library. Smash Illustrations Smash Illustrations Free mix & match illustration constructor. Open Doodles Open Doodles A collection of free sketchy illustrations. Control Illustrations Control Illustrations 108 free flat illustrations with customisable characters. Ouch! Ouch! Free vector illustrations to class up your project. Avataaars Generator Avataaars Generator A simple web app for generating hand-drawn avatars. Faux Code Generator Faux Code Generator Turn real code (Github Gist) into faux code (SVG image). Palette Parametric Color Mixer Parametric Color Mixer A colour palette composer inspired by audio parametric equalisers. CSS Gradient CSS Gradient A simple and colorful CSS gradient generator. Colorsinspo Colorsinspo Thousands of beautiful colour palettes you can use in one click. Color Hexa Color Hexa A free colour tool providing information about any colour and generating matching colour palettes, shades/tints for your designs. Color Space Color Space Generate nice colour palettes, gradients, and matching colour schemes for your next project! Palettte App Palettte App Create, analyse and edit smooth colour palettes. Colorable Colorable A colour combination contrast tester. Typography Freebiesbug (free fonts) Freebiesbug (free fonts) Handpicked free fonts and typefaces for web and graphics designers. Fonts Arena Fonts Arena Free fonts, and free alternatives to premium fonts. Befonts Befonts Download the free fonts for personal or commercial use. Font Squirrel Font Squirrel Download thousands of completely legal, high quality, free fonts. Fontjoy Fontjoy Easily mix and match different Google Fonts for the perfect pairing. Type Scale Type Scale Preview and choose the right type scale for your project. Experiment with font size, scale and different web fonts. Animations & Effects Smooth Shadow Generator Smooth Shadow Generator Make a smooth shadow with easing curves. CSSeffectsSnippets CSSeffectsSnippets A collection of CSS effects made with Vue.js. Separator Generator Separator Generator A collection of customisable CSS section separators, with the possibility to easily copy the code. Animista Animista A place where you can play with a collection of ready to use CSS animations, tweak them and download only those you will actually use. Draggable Draggable A lightweight, responsive, modern drag & drop library. Block Reveal Effects Block Reveal Effects Ideas for revealing content in a schematic box look. Iconography IconStore IconStore A library of free vector icons for personal and commercial projects, designed by first-class designers. CSS Icons CSS Icons Open-source CSS, SVG and Figma UI Icons available in SVG Sprite, styled-components, NPM & API. Icon Transition Generator Icon Transition Generator Create a snappy transition between two icons and download the SVG code. Tilda Icons Tilda Icons A collection of 700+ free icons for landing pages. Ikonate Ikonate Fully customisable & accessible vector icons. Eva Icons Eva Icons Eva Icons is a pack of more than 480 beautifully crafted Open Source icons for common actions and items. Animated Icons Animated Icons 400 free animated icons downloadable in JSON for Lottie, GIF, and After Effects format. Patterns & Shapes CSS Patterns CSS Patterns CSS only library to fill your empty background with beautiful patterns. Get Waves Get Waves A simple web app to generate svg waves, unique every time. Blob Maker Blob Maker Create organic SVG shapes in just a few seconds. Rad Lines Rad Lines A web tool for generating SVGs of polygons for plotting. Patterns Patterns Free collection of beautiful patterns for all vector formats. Scribbbles Scribbbles 100+ vectorised scribbbles to spice up your design projects. Utility Nucleo App Nucleo App A powerful application to collect, customise and export all your icons. Checklist design Checklist design A collection of the best UX and UI practices. Design System Repo Design System Repo A comprehensive and curated list of design systems, style guides and pattern libraries that you can use for inspiration. CSSPeeper CSSPeeper Inspect styles in a simple, well-organised & beautiful way. AI Image Upscaler AI Image Upscaler Enlarge and enhance images automatically using AI. Conclusion I hope you enjoyed this list of free tools and resources. Hungry for more? Take a look at part 2 here.
70 JavaScript Interview Questions Mark A https devto macmacky 70-javascript-interview-questions-5gfi Hi Guys Good Day and a Happy New Year 🎆🎆🎆 This is a long one so bear with me for a second or an hour In every answer for every question there s an arrow up ↑ link that lets you go back to the List of Questions so that you don t waste time scrolling up and down The Questions 1 What s the difference between undefined and null 2 What does the && operator do 3 What does the operator do 4 Is using the + or unary plus operator the fastest way in converting a string to a number 5 What is the DOM 6 What is Event Propagation 7 What s Event Bubbling 8 What s Event Capturing 9 What s the difference between eventpreventDefault and eventstopPropagation methods 10 How to know if the eventpreventDefault method was used in an element 11 Why does this code objsomepropx throw an error 12 What is eventtarget 13 What is eventcurrentTarget 14 What s the difference between and 15 Why does it return false when comparing two similar objects in JavaScript 16 What does the operator do 17 How to evaluate multiple expressions in one line 18 What is Hoisting 19 What is Scope 20 What are Closures 21 What are the falsy values in JavaScript 22 How to check if a value is falsy 23 What does use strict do 24 What s the value of this in JavaScript 25 What is the prototype of an object 26 What is an IIFE what is the use of it 27 What is the use Functionprototypeapply method 28 What is the use Functionprototypecall method 29 What s the difference between Functionprototypeapply and Functionprototypecall 30 What is the usage of Functionprototypebind 31 What is Functional Programming and what are the features of JavaScript that makes it a candidate as a functional language 32 What are Higher Order Functions 33 Why are functions called First-class Objects 34 Implement the Arrayprototypemap method by hand 35 Implement the Arrayprototypefilter method by hand 36 Implement the Arrayprototypereduce method by hand 37 What is the arguments object 38 How to create an object without a prototype 39 Why does b in this code become a global variable when you call this function 40 What is ECMAScript 41 What are the new features in ES6 or ECMAScript 2015 42 What s the difference between var let and const keywords 43 What are Arrow functions 44 What are Classes 45 What are Template Literals 46 What is Object Destructuring 47 What are ES6 Modules 48 What is the Set object and how does it work 49 What is a Callback function 50 What are Promises 51 What is async await and How does it work 52 What s the difference between Spread operator and Rest operator 53 What are Default Parameters 54 What are Wrapper Objects 55 What is the difference between Implicit and Explicit Coercion 56 What is NaN and How to check if a value is NaN 57 How to check if a value is an Array 58 How to check if a number is even without using the % or modulo operator 59 How to check if a certain property exists in an object 60 What is AJAX 61 What are the ways of making objects in JavaScript 62 What s the difference between Objectseal and Objectfreeze methods 63 What s the difference between the in operator and the hasOwnProperty method in objects 64 What are the ways to deal with Asynchronous Code in JavasScript 65 What s the difference between a function expression and function declaration 66 How many ways can a function be invoked 67 What is memoization and what s the use it 68 Implement a memoization helper function 69 Why does typeof null return object How to check if a value is null 70 What does the new keyword do 1 What s the difference between undefined and null ↑ Before understanding the differences between undefined and null we must understand the similarities between them They belong to JavaScript s 7 primitive types let primitiveTypes string number null undefined boolean symbol bigint They are falsy values Values that evaluated to false when converting it to boolean using Boolean value or value consolelog null logs false consolelog undefined logs false consolelog Boolean null logs false consolelog Boolean undefined logs false Ok let s talk about the differences undefined is the default value of a variable that has not been assigned a specific value Or a function that has no explicit return value ex consolelog 1 Or a property that does not exist in an object The JavaScript engine does this for us the assigning of undefined value let _thisIsUndefined const doNothing const someObj a ay b bee c si consolelog _thisIsUndefined logs undefined consolelog doNothing logs undefined consolelog someObjd logs undefined null is a value that represents no value null is value that has been explicitly defined to a variable In this example we get a value of null when the fsreadFile method does not throw an error fsreadFile path to file e data consolelog e it logs null when no error occurred if e consolelog e consolelog data When comparing null and undefined we get true when using and false when using You can read the reason here consolelog null undefined logs true consolelog null undefined logs false 2 What does the && operator do ↑ The && or Logical AND operator finds the first falsy expression in its operands and returns it and if it does not find any falsy expression it returns the last expression It employs short-circuiting to prevent unnecessary work I ve used this in the catch block when closing database connection in one of my projects consolelog false && 1 && [] logs false consolelog && true && 5 logs 5 Using if statements const router Router Router routerget endpoint req Request res Response let conMobile PoolConnection try do some db operations catch e if conMobile conMobilerelease Using && operator const router Router Router routerget endpoint req Request res Response let conMobile PoolConnection try do some db operations catch e conMobile && conMobilerelease 3 What does the operator do ↑ The or Logical OR operator finds the first truthy expression in its operands and returns it This too employs short-circuiting to prevent unnecessary work It was used before to initialize default parameter values IN functions before ES6 Default function parameters was supported consolelog null 1 undefined logs 1 function logName name var n name Mark consolelog n logName logs Mark 4 Is using the + or unary plus operator the fastest way in converting a string to a number ↑ According to MDN Documentation the + is the fastest way of converting a string to a number because it does not perform any operations on the value if it is already a number 5 What is the DOM ↑ DOM stands for Document Object Model is an interface API for HTML and XML documents When the browser first reads parses our HTML document it creates a big object a really big object based on the HTML document this is the DOM It is a tree-like structure that is modeled from the HTML document The DOM is used for interacting and modifying the DOM structure or specific Elements or Nodes Imagine if we have an HTML structure like this DOCTYPE html html lang en head meta charset UTF-8 meta name viewport content widthdevice-width initial-scale10 meta http-equiv X-UA-Compatible content ieedge titleDocument Object Model title head body div p span span p label label input div body html The DOM equivalent would be like this DOM equivalent The document object in JavaScript represents the DOM It provides us many methods that we can use to selecting elements to update element contents and many more 6 What is Event Propagation ↑ When an event occurs on a DOM element that event does not entirely occur on that just one element In the Bubbling Phase the event bubbles up or it goes to its parent to its grandparents to its grandparent s parent until it reaches all the way to the window while in the Capturing Phase the event starts from the window down to the element that triggered the event or the eventtarget Event Propagation has three phases Capturing Phase – the event starts from window then goes down to every element until it reaches the target element Target Phase – the event has reached the target element Bubbling Phase – the event bubbles up from the target element then goes up every element until it reaches the window Event Propagation 7 What s Event Bubbling ↑ When an event occurs on a DOM element that event does not entirely occur on that just one element In the Bubbling Phase the event bubbles up or it goes to its parent to its grandparents to its grandparent s parent until it reaches all the way to the window If we have an example markup like this div class grandparent div class parent div class child 1 div div div And our js code function addEvent el event callback isCapture false if el event callback typeof callback function return if typeof el string el documentquerySelector el eladdEventListener event callback isCapture addEvent document DOMContentLoaded const child documentquerySelector child const parent documentquerySelector parent const grandparent documentquerySelector grandparent addEvent child click function e consolelog child addEvent parent click function e consolelog parent addEvent grandparent click function e consolelog grandparent addEvent document click function e consolelog document addEvent html click function e consolelog html addEvent window click function e consolelog window The addEventListener method has a third optional parameter useCapture with a default value of false the event will occur in the Bubbling phase if true the event will occur in the Capturing Phase If we click on the child element it logs child parent grandparent html document and window respectively on the console This is Event Bubbling 8 What s Event Capturing ↑ When an event occurs on a DOM element that event does not entirely occur on that just one element In Capturing Phase the event starts from the window all the way down to the element that triggered the event If we have an example markup like this div class grandparent div class parent div class child 1 div div div And our js code function addEvent el event callback isCapture false if el event callback typeof callback function return if typeof el string el documentquerySelector el eladdEventListener event callback isCapture addEvent document DOMContentLoaded const child documentquerySelector child const parent documentquerySelector parent const grandparent documentquerySelector grandparent addEvent child click function e consolelog child true addEvent parent click function e consolelog parent true addEvent grandparent click function e consolelog grandparent true addEvent document click function e consolelog document true addEvent html click function e consolelog html true addEvent window click function e consolelog window true The addEventListener method has a third optional parameter useCapture with a default value of false the event will occur in the Bubbling phase if true the event will occur in the Capturing Phase If we click on the child element it logs window document html grandparent and parent and child respectively on the console This is Event Capturing 9 What s the difference between eventpreventDefault and eventstopPropagation methods ↑ The eventpreventDefault method prevents the default behavior of an element If used in a form element it prevents it from submitting If used in an anchor element it prevents it from navigating If used in a contextmenu it prevents it from showing or displaying While the eventstopPropagation method stops the propogation of an event or it stops the event from occurring in the bubbling or capturing phase 10 How to know if the eventpreventDefault method was used in an element ↑ We can use the eventdefaultPrevented property in the event object It returns a boolean indicating if the eventpreventDefault was called in a particular element 11 Why does this code objsomepropx throw an error const obj consolelog objsomepropx ↑Obviously this throws an error due to the reason we are trying to access a x property in the someprop property which have an undefined value Remember properties in an object which does not exist in itself and its prototype has a default value of undefined and undefined has no property x 12 What is eventtarget ↑ In simplest terms the eventtarget is the element on which the event occurred or the element that triggered the event Sample HTML Markup div onclick clickFunc event style text-align center margin15px border1px solid red border-radius3px div style margin 25px border1px solid royalblue border-radius3px div style margin25px border1px solid skyblue border-radius3px button style margin10px Button button div div div Sample JavaScript function clickFunc event consolelog eventtarget If you click the button it will log the button markup even though we attach the event on the outermost div it will always log the button so we can conclude that the eventtarget is the element that triggered the event 13 What is eventcurrentTarget ↑ The eventcurrentTarget is the element on which we attach the event handler explicitly Copying the markup in Question 12 Sample HTML Markup div onclick clickFunc event style text-align center margin15px border1px solid red border-radius3px div style margin 25px border1px solid royalblue border-radius3px div style margin25px border1px solid skyblue border-radius3px button style margin10px Button button div div div And changing our the JS a little bit function clickFunc event consolelog eventcurrentTarget If you click the button it will log the outermost div markup even though we click the button In this example we can conclude that the eventcurrentTarget is the element on which we attach the event handler 14 What s the difference between and ↑ The difference between abstract equality and strict equality is that the compares by value after coercion and compares by value and type without coercion Let s dig deeper on the So first let s talk about coercion coercion is the process of converting a value to another type As in this case the does implicit coercion The has some conditions to perform before comparing the two values Suppose we have to compare x y values If x and y have same type Then compare them with the operator If x is null and y is undefined then return true If x is undefined and y is null then return true If x is type number and y is type string Then return x toNumber y If x is type string and y is type number Then return toNumber x y If x is type boolean Then return toNumber x y If y is type boolean Then return x toNumber y If x is either string symbol or number and y is type object Then return x toPrimitive y If x is either object and x is either string symbol Then return toPrimitive x y Return false Note toPrimitive uses first the valueOf method then the toString method in objects to get the primitive value of that object Let s have examples x y x y 5 5 true 1 1 true null undefined true 0 false true 1 2 [1 2] true [object Object] true These examples all return true The first example goes to condition one because x and y have the same type and value The second example goes to condition four y is converted to a number before comparing The third example goes to condition two The fourth example goes to condition seven because y is boolean The fifth example goes to condition eight The array is converted to a string using the toString method which returns 1 2 The last example goes to condition ten The object is converted to a string using the toString method which returns [object Object] x y x y 5 5 true 1 1 false null undefined false 0 false false 1 2 [1 2] false [object Object] false If we use the operator all the comparisons except for the first example will return false because they don t have the same type while the first example will return true because the two have the same type and value 15 Why does it return false when comparing two similar objects in JavaScript ↑ Suppose we have an example below let a a 1 let b a 1 let c a consolelog a b logs false even though they have the same property consolelog a c logs true hmm JavaScript compares objects and primitives differently In primitives it compares them by value while in objects it compares them by reference or the address in memory where the variable is stored That s why the first consolelog statement returns false and the second consolelog statement returns true a and c have the same reference and a and b are not 16 What does the operator do ↑ The Double NOT operator or coerces the value on the right side into a boolean basically it s a fancy way of converting a value into a boolean consolelog null logs false consolelog undefined logs false consolelog logs false consolelog 0 logs false consolelog NaN logs false consolelog logs true consolelog logs true consolelog [] logs true consolelog 1 logs true consolelog []length logs false 17 How to evaluate multiple expressions in one line ↑We can use the or comma operator to evaluate multiple expressions in one line It evaluates from left-to-right and returns the value of the last item on the right or the last operand let x 5 x x++ x addFive x x * 2 x 5 x + 10 function addFive num return num + 5 If you log the value of x it would be 27 First we increment the value of x it would be 6 then we invoke the function addFive 6 and pass the 6 as a parameter and assign the result to x the new value of x would be 11 After that we multiply the current value of x to 2 and assign it to x the updated value of x would be 22 Then we subtract the current value of x to 5 and assign the result to x the updated value would be 17 And lastly we increment the value of x by 10 and assign the updated value to x now the value of x would be 27 18 What is Hoisting ↑ Hoisting is the term used to describe the moving of variables and functions to the top of their global or function scope on where we define that variable or function Ok to understand Hoisting I have to explain the execution context The Execution Context is the environment of code that is currently executing The Execution Context has two phases compilation and execution Compilation in this phase it gets all the function declarations and hoists them up to the top of their scope so we can reference them later and gets all variables declaration declare with the var keyword and also hoists them up and give them a default value of undefined Execution in this phase it assigns values to the variables hoisted earlier and it executes or invokes functions methods in objects Note only function declarations and variables declared with the var keyword are hoisted not function expressions or arrow functions let and const keywords Ok suppose we have an example code in the global scope below consolelog y y 1 consolelog y consolelog greet Mark function greet name return Hello + name + var y This code logs undefined 1 Hello Mark respectively So the compilation phase would look like this function greet name return Hello + name + var y implicit undefined assignment waiting for compilation phase to finish then start execution phase * consolelog y y 1 consolelog y consolelog greet Mark * for example purposes I commented on the assignment of variable and function call After the compilation phase finishes it starts the execution phase invoking methods and assigns values to variables function greet name return Hello + name + var y start execution phase consolelog y y 1 consolelog y consolelog greet Mark 19 What is Scope ↑ Scope in JavaScript is the area where we have valid access to variables or functions JavaScript has three types of Scopes Global Scope Function Scope and Block Scope ES6 Global Scope variables or functions declared in the global namespace are in the global scope and therefore is accessible everywhere in our code global namespace var g global function globalFunc function innerFunc consolelog g can access g because g is a global variable innerFunc Function Scope variables functions and parameters declared within a function are accessible inside that function but not outside of it function myFavoriteFunc a if true var b Hello + a return b myFavoriteFunc World consolelog a Throws a ReferenceError a is not defined consolelog b does not continue here Block Scope variables let const declared within a block can only be access within it function testBlock if true let z 5 return z testBlock Throws a ReferenceError z is not defined Scope is also a set of rules for finding variables If a variable does not exist in the current scope it look ups and searches for a variable in the outer scope and if does not exist again it looks up again until it reaches the global scope if the variable exists then we can use it if not it throws an error It searches for the nearest variable and it stops searching or looking up once it finds it This is called Scope Chain * Scope Chain Inside inner function perspective inner s scope outer s scope global s scope * Global Scope var variable1 Comrades var variable2 Sayonara function outer outer s scope var variable1 World function inner inner s scope var variable2 Hello consolelog variable2 + + variable1 inner outer logs Hello World because variable2 Hello and variable1 World are the nearest variables inside inner s scope Scope 20 What are Closures ↑ This is probably the hardest question of all these questions because Closures is a controversial topic So I m gonna explain it from what I understand Closures is simply the ability of a function at the time of declaration to remember the references of variables and parameters on its current scope on its parent function scope on its parent s parent function scope until it reaches the global scope with the help of Scope Chain Basically it is the Scope created when the function was declared Examples are a great way to explain closures Global s Scope var globalVar abc function a testClosures s Scope consolelog globalVar a logs abc * Scope Chain Inside a function perspective a s scope global s scope * In this example when we declare the a function the Global Scope is part of a s closure a s closure The reason for the variable globalVar which does not have a value in the image because of the reason that the value of that variable can change based on where and when we invoke the a function But in our example above the globalVar variable will have the value of abc Ok let s have a complex example var globalVar global var outerVar outer function outerFunc outerParam function innerFunc innerParam consolelog globalVar outerParam innerParam return innerFunc const x outerFunc outerVar outerVar outer-2 globalVar guess x inner Complex This will print guess outer inner The explanation for this is that when we invoke the outerFunc function and assigned the returned value the innerFunc function to the variable x the outerParam will have a value of outer even though we assign a new value outer-2 to the outerVar variable because the reassignment happened after the invocation of the outer function and in that time when we invoke the outerFunc function it s look up the value of outerVar in the Scope Chain the outerVar will have a value of outer Now when we invoke the x variable which have a reference to the innerFunc the innerParam will have a value of inner because thats the value we pass in the invocation and the globalVar variable will have a value of guess because before the invocation of the x variable we assign a new value to the globalVar and at the time of invocation x the value of globalVar in the_Scope Chain_ is guess We have an example that demonstrates a problem of not understanding closure correctly const arrFuncs [] for var i 0 i 5 i++ arrFuncspush function return i consolelog i i is 5 for let i 0 i arrFuncslength i++ consolelog arrFuncs[i] all logs 5 This code is not working as we expected because of Closures The var keyword makes a global variable and when we push a function we return the global variable i So when we call one of those functions in that array after the loop it logs 5 because we get the current value of i which is 5 and we can access it because it s a global variable Because Closures keeps the references of that variable not its values at the time of it s creation We can solve this using IIFES or changing the var keyword to let for block-scoping 21 What are the falsy values in JavaScript ↑ const falsyValues 0 null undefined NaN false] falsy values are values that when converted to boolean becomes false 22 How to check if a value is falsy ↑ Use the Boolean function or the Double NOT operator 23 What does use strict do ↑ use strict is a ES5 feature in JavaScript that makes our code in Strict Mode in functions or entire scripts Strict Mode helps us avoid bugs early on in our code and adds restrictions to it Restrictions that Strict Mode gives us Assigning or Accessing a variable that is not declared function returnY use strict y 123 return y Assigning a value to a read-only or non-writable global variable use strict var NaN NaN var undefined undefined var Infinity and beyond Deleting an undeletable property use strict const obj ObjectdefineProperty obj x value 1 delete objx Duplicate parameter names use strict function someFunc a b b c Creating variables with the use of the eval function use strict eval var x 1 consolelog x Throws a Reference Error x is not defined The default value of this will be undefined use strict function showMeThis return this showMeThis returns undefined There are many more restrictions in Strict Mode than these 24 What s the value of this in JavaScript ↑ Basically this refers to the value of the object that is currently executing or invoking the function I say currently due to the reason that the value of this changes depending on the context on which we use it and where we use it const carDetails name Ford Mustang yearBought 2005 getName return thisname isRegistered true consolelog carDetailsgetName logs Ford Mustang This is what we would normally expect because in the getName method we return thisname this in this context refers to the object which is the carDetails object that is currently the owner object of the function executing Ok Let s some add some code to make it weird Below the consolelog statement add this three lines of code var name Ford Ranger var getCarName carDetailsgetName consolelog getCarName logs Ford Ranger The second consolelog statement prints the word Ford Ranger which is weird because in our first consolelog statement it printed Ford Mustang The reason to this is that the getCarName method has a different owner object that is the window object Declaring variables with the var keyword in the global scope attaches properties in the window object with the same name as the variables Remember this in the global scope refers to the window object when use strict is not used consolelog getCarName windowgetCarName logs true consolelog getCarName thisgetCarName logs true this and window in this example refer to the same object One way of solving this problem is by using the apply and call methods in functions consolelog getCarNameapply carDetails logs Ford Mustang consolelog getCarNamecall carDetails logs Ford Mustang The apply and call methods expects the first parameter to be an object which would be value of this inside that function IIFE or Immediately Invoked Function Expression Functions that are declared in the global scope Anonymous Functions and Inner functions in methods inside an object has a default of this which points to the window object function consolelog this logs the window object function iHateThis consolelog this iHateThis logs the window object const myFavoriteObj guessThis function getThis consolelog this getThis name Marko Polo thisIsAnnoying callback callback myFavoriteObjguessThis logs the window object myFavoriteObjthisIsAnnoying function consolelog this logs the window object If we want to get the value of the name property which is Marko Polo in the myFavoriteObj object there are two ways to solve this First we save the value of this in a variable const myFavoriteObj guessThis const self this saves the this value to the self variable function getName consolelog selfname getName name Marko Polo thisIsAnnoying callback callback In this image we save the value of this which would be the myFavoriteObj object So we can access it inside the getName inner function Second we use ES6 Arrow Functions const myFavoriteObj guessThis const getName copies the value of this outside of this arrow function consolelog thisname getName name Marko Polo thisIsAnnoying callback callback Arrow Functions does not have its own this It copies the value of this of the enclosing lexical scope or in this example the value of this outside the getName inner function which would be the myFavoriteObj object We can also determine the value of this on how the function is invoked 25 What is the prototype of an object ↑ A prototype in simplest terms is a blueprint of an object It is used as a fallback for properties and methods if it does exist in the current object It s the way to share properties and functionality between objects It s the core concept around JavaScript s Prototypal Inheritance const o consolelog otoString logs [object Object] Even though the otoString method does not exist in the o object it does not throw an error instead returns a string [object Object] When a property does not exist in the object it looks into its prototype and if it still does not exist it looks into the prototype s prototype and so on until it finds a property with the same in the Prototype Chain The end of the Prototype Chain is the Objectprototype consolelog otoString ObjectprototypetoString logs true which means we we re looking up the Prototype Chain and it reached the Objectprototype and used the toString method 26 What is an IIFE what is the use of it ↑ An IIFE or Immediately Invoked Function Expression is a function that is gonna get invoked or executed after its creation or declaration The syntax for creating IIFE is that we wrap the function inside a parentheses or the Grouping Operator to treat the function as an expression and after that we invoke it with another parentheses So an IIFE looks like this function function function function named params function global window const utility function return utilities Thes
🚀⚙️ JavaScript Visualized: the JavaScript Engine Lydia Hallie https://dev.to/lydiahallie/javascript-visualized-the-javascript-engine-4cdf JavaScript is cool (don't @ me), but how can a machine actually understand the code you've written? As JavaScript devs, we usually don't have to deal with compilers ourselves. However, it's definitely good to know the basics of the JavaScript engine and see how it handles our human-friendly JS code, and turns it into something machines understand! 🥳 | Note: This post is mainly based on the V8 engine used by Node.js and Chromium-based browsers. The HTML parser encounters a script tag with a source. Code from this source gets loaded from either the network, cache, or an installed service worker. The response is the requested script as a stream of bytes, which the byte stream decoder takes care of! The byte stream decoder decodes the stream of bytes as it's being downloaded. Alt Text The byte stream decoder creates tokens from the decoded stream of bytes. For example, 0066 decodes to f, 0075 to u, 006e to n, 0063 to c, 0074 to t, 0069 to i, 006f to o, and 006e to n followed by a white space. Seems like you wrote function! This is a reserved keyword in JavaScript, a token gets created, and sent to the parser (and pre-parser, which I didn't cover in the gifs but will explain later). The same happens for the rest of the byte stream. Alt Text The engine uses two parsers: the pre-parser, and the parser. In order to reduce the time it takes to load up a website, the engine tries to avoid parsing code that's not necessary right away. The preparser handles code that may be used later on, while the parser handles the code that's needed immediately! If a certain function will only get invoked after a user clicks a button, it's not necessary that this code is compiled immediately just to load up a website. If the user eventually ends up clicking the button and requiring that piece of code, it gets sent to the parser. The parser creates nodes based on the tokens it receives from the byte stream decoder. With these nodes, it creates an Abstract Syntax Tree, or AST. 🌳 Alt Text Next, it's time for the interpreter! The interpreter which walks through the AST, and generates byte code based on the information that the AST contains. Once the byte code has been generated fully, the AST is deleted, clearing up memory space. Finally, we have something that a machine can work with! 🎉 Alt Text Although byte code is fast, it can be faster. As this bytecode runs, information is being generated. It can detect whether certain behavior happens often, and the types of the data that's been used. Maybe you've been invoking a function dozens of times: it's time to optimize this so it'll run even faster! 🏃🏽‍♀️ The byte code, together with the generated type feedback, is sent to an optimizing compiler. The optimizing compiler takes the byte code and type feedback, and generates highly optimized machine code from these. 🚀 Alt Text JavaScript is a dynamically typed language, meaning that the types of data can change constantly. It would be extremely slow if the JavaScript engine had to check each time which data type a certain value has. In order to reduce the time it takes to interpret the code, optimized machine code only handles the cases the engine has seen before while running the bytecode. If we repeatedly used a certain piece of code that returned the same data type over and over, the optimized machine code can simply be re-used in order to speed things up. However, since JavaScript is dynamically typed, it can happen that the same piece of code suddenly returns a different type of data. If that happens, the machine code gets de-optimized, and the engine falls back to interpreting the generated byte code. Say a certain function is invoked a 100 times and has always returned the same value so far. It will assume that it will also return this value the 101st time you invoke it. Let's say that we have the following function sum, that's (so far) always been called with numerical values as arguments each time: This returns the number 3! The next time we invoke it, it will assume that we're invoking it again with two numerical values. If that's true, no dynamic lookup is required, and it can just re-use the optimized machine code. Else, if the assumption was incorrect, it will revert back to the original byte code instead of the optimized machine code. For example, the next time we invoke it, we pass a string instead of a number. Since JavaScript is dynamically typed, we can do this without any errors! This means that the number 2 will get coerced into a string, and the function will return the string "12" instead. It goes back to executing the interpreted bytecode and updates the type feedback. I hope this post was useful to you! 😊 Of course, there are many parts to the engine that I haven't covered in this post (JS heap, call stack, etc.) which I might cover later! I definitely encourage you to start to doing some research yourself if you're interested in the internals of JavaScript, V8 is open source and has some great documentation on how it works under the hood! 🤖 V8 Docs || V8 Github || Chrome University 2018: Life Of A Script Feel free to reach out to me! Twitter || Instagram || GitHub || LinkedIn FAQ: I use Keynote to make the animations and screen record it lol. Feel free to translate this blog to your language, and thanks so much for doing so! Just keep a reference to the original article and let me know if you've translated it please! 😊
The Interview Study Guide For Software Engineers SeattleDataGuy https://dev.to/seattledataguy/the-interview-study-guide-for-software-engineers-764 By Ben Rogojan Software engineering interviews, like other technical interviews, require plenty of preparation. There are a number of subjects that need to be covered in order to ensure you are ready for back-to-back questions on algorithms, data structures, design, optimization and honestly just an ever growing basket of subjects. So I created a checklist on my last round of interviews that covers many of the popular topics. To help you keep track of your progress, we've compiled a comprehensive checklist of the same problems listed below; that list can be found here. Warm Up With The Classics Fizz Buzz 560. Subarray Sum Equals K Arrays: Left Rotation Strings: Making Anagrams Nth Fibonacci How did you do? Take a moment and rate yourself on these classics. We have been asked most of these at some point in the interview process and often early on as weed-out style questions. They often have less to do with algorithms and data structures, but still require a good understanding of loops and arrays (yes, an array is a data structure). Algorithms And Data Structures Pre-Study Problems Before going through the video content about data structures and algorithms, consider trying out these problems below. See if you can answer them. This will help you know what to focus on. 985. Sum of Even Numbers After Queries 657. Robot Return to Origin 961. N-Repeated Element in Size 2N Array 110. Balanced Binary Tree 3. Longest Substring Without Repeating Characters 19. Remove Nth Node From End of List 23. Merge k Sorted Lists 31. Next Permutation Algorithms And Data Structures Videos Data Structures Data Structures & Algorithms #1   What Are Data Structures?   Video Multi-dim   Video Dynamic Arrays   Video Resizing arrays   Video Data Structures: Linked Lists   Video Core Linked Lists Vs Arrays   Video Pointers to Pointers   Video Data Structures: Trees   Video Data Structures: Heaps   Video Data Structures: Hash Tables   Video Phone Book Problem   Video Data Structures: Stacks and Queues   Video Using Stacks Last-In First-Out   Video Data Structures: Crash Course Computer Science #14   Video Data Structures: Tries   Video Algorithms Algorithms: Graph Search, DFS and BFS   Video BFS(breadth-first search) and DFS(depth-first search)   Video Algorithms: Binary Search   Video Binary Search Tree Review   Video Python Algorithms for Interviews   Video Algorithms: Recursion   Video Algorithms: Bubble Sort   Video Algorithms: Merge Sort   Video Algorithms: Quicksort   Video Big O Notation Introduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7)   Video Harvard CS50   Asymptotic Notation   Video A Gentle Introduction to Algorithm Complexity Analysis   Post Cheat sheet   Post Dynamic Programming Dynamic Programming (Think Like a Programmer)   Video Algorithms: Memoization and Dynamic Programming   Video 6.006: Dynamic Programming I: Fibonacci, Shortest Paths   Video 6.006: Dynamic Programming II: Text Justification, Blackjack   Video Dynamic Programming   Post String Manipulation Coding Interview Question and Answer: Longest Consecutive Characters   Video Sedgewick   Substring Search   Video Interview Problem Walk-throughs Google Coding Interview   Universal Value Tree Problem   Video Google Coding Interview Question and Answer #1: First Recurring Character   Video Find min and max element in a binary search tree   Video Find height of a binary tree   Video Check if a binary tree is binary search tree or not   Video What Is Tail Recursion? Why Is It So Bad?   Video Post-Study Problems Now that you have studied for a bit, and watched a few videos, let's try some more problems! Bigger Is Greater 6. ZigZag Conversion 7. Reverse Integer 40. Combination Sum II 43. Multiply Strings Larry's Array Short Palindrome 65. Valid Number Bigger is Greater The Full Counting Sort Lily's Homework Common Child 459. Repeated Substring Pattern 27. Remove Element 450. Delete Node in a BST 659. Split Array into Consecutive Subsequences Number of Subarrays with Bounded Maximum Combination Sum IV Best Time to Buy and Sell Stock with Cooldown Longest Repeating Character Replacement Swap Nodes in Pairs Binary Tree Right Side View Flatten Nested List Iterator Binary Tree Level Order Traversal Binary Search Tree Iterator Maximum Length of Pair Chain Split Linked List in Parts Operational Programming Problems Some companies won't ask you algorithm problems. Instead, they might focus more on implementation and operational problems. These are usually more niche and involve practical problems, like looping through data and performing a task of some sort. These types of problems don't usually require as much practice because it is more about taking basic concepts like arrays and HashMaps and keeping track of what you are doing to them. Kangaroo Problem Breaking Records Find A Stringiter No Idea! Days of the programmer Leaderboard Word Order Sherlock And Squares Equalize The Array Apples And Oranges More Operational Style Questions System Design Videos System design questions are crucial questions that show you are more than just a coder. You need to be able to think big picture as an engineer. Where do certain services belong, what kind of servers do you need, how would you manage traffic, etc. All of these ideas show that you are able to design software, not just code what people tell you to code. Parking Lot System   Video Whats App   Video Uber design   Video Instagram   Video Tinder Service   Video Operating Systems Operating system questions are a little more rare, but it is good to have a solid understanding of concepts like threads, scheduling, memory, etc., even if it is just a basic understanding. It is very embarrassing to get asked what the difference is between a process and a thread and not know the answer. Commonly Asked Operating Systems Interview Questions What is Translation lookaside buffer? Why does Round Robin avoid the Priority Inversion Problem? Interrupt Vs System Call What is 'inode' in file system? Operating System Interview Questions and Answers   Part I What is a kernel   Gary explains Round Robin Algorithm Tutorial (CPU Scheduling) The Magic of LRU Cache (100 Days of Google Dev)   Video MIT 6.004 L15: The Memory Hierarchy   Video Interrupts   Video Scheduling   Video Threads User Level thread Vs Kernel Level thread Intro to Processes & Threads   Video Difference Between Process and Thread   Georgia Tech   Advanced Operating Systems   Video Difference between forking and multithreading Object Oriented Similar to operating systems, not every interview will ask you about object-oriented programming, but you never know. You want to make sure you remember your basics from your computer 162 course. Java Programming Tutorial   49   Inheritance   Video Java Programming Tutorial   55   Introduction to Polymorphism   Video Java Programming Tutorial   58   Abstract and Concrete Classes   Video Java Programming Tutorial   57   Overriding Rules   Video Java Programming Tutorial   59   Class to Hold Objects Object-Oriented Programming   Video Design Patterns If you were like us, we weren't taught about all the various design patterns. So it's good to get an understanding of how they work and why you would use them. Some interview questions can be as simple as,"Why would you use a factory class?" Factory Design Pattern   Video Observer Design Pattern   Video Adapter Design Pattern   Video Facade Design Pattern   Video Chain of Responsibility Design Pattern   Video Interpreter Design Pattern   Video Singleton Design Pattern Tutorial   Video Chapter 6 (Part 1)   Patterns (video)   Video Head First Design Patterns   Video SQL This is the last section. Many of you probably won't be asked that many SQL questions. However, I always think it is good to have in your back pocket. SQL   Problems 262. Trips and Users 601. Human Traffic of Stadium 185. Department Top Three Salaries 626. Exchange Seats Hackerrank The Report 177. Nth Highest Salary Symmetric Pairs OccupationsPlacements Ollivander's Inventory SQL   Videos IQ15: 6 SQL Query Interview Questions   Video Learning about ROW_NUMBER and Analytic Functions   Video Advanced Implementation Of Analytic Functions   Video Advanced Implementation Of Analytic Functions Part 2   Video Wise Owl SQL Videos   Video Post SQL Problems Binary Tree Nodes Weather Observation Station 18 ChallengesPrint Prime Numbers 595. Big Countries 626. Exchange Seats SQL Interview Questions: 3 Tech Screening Exercises (For Data Analysts) Interviewing can be tough because you can feel like you are making no progress. Having this study guide will help you track your progress and give you a better read on how you are doing! Good luck! Also, if you are looking to read/watch more great posts or videos: Connecting To Big Query Using Jupyter Notebook On SaturnCloud Part 2 Three Books You Should Read As A Data Scientist Hadoop Vs Relational Databases How Algorithms Can Become Unethical and Biased How To Improve Your Data Driven Strategy How To Develop Robust Algorithms 4 Must Have Skills For Data Scientists SQL Best Practices — Designing An ETL Video
9 Projects you can do to become a Frontend Master in 2020 Simon Holdorf https://dev.to/simonholdorf/9-projects-you-can-do-to-become-a-frontend-master-in-2020-n2h Introduction Whether you are new to programming or already an experienced developer. In this industry, learning new concepts and languages/frameworks is mandatory to keep up with the rapid changes. Take for example React - open-sourced by Facebook just a shy 4 years ago it already became the number one choice for JavaScript devs around the globe. But also Vue and Angular, of course, have their legitimate follower-base. And then there is Svelte, and universal frameworks like Next.js or Nuxt.js, and Gatsby, and Gridsome, and Quasar, and and and. If you want to shine as an expert JavaScript developer you should at least have some experience in different frameworks and libraries - besides doing your homework with good, old JS. To help you become Frontend Masters in 2020 I have collected 9 different projects, each with a distinct topic and a different JavaScript framework or library as a tech stack that you can build and add to your portfolio. Remember, nothing helps you more than actually building stuff so go ahead, sharpen your mind and make this happen! Build a movie search app using React (with hooks) The first thing you could start with is building a movie search app using React. Below is an image of how the final app will look like: Example project React What you will learn Building this application you will improve your React Skills using the relatively new Hooks API. The example projects make use of React components, many hooks, an external API, and of course some styling via CSS. Tech Stack & Features React with Hooks create-react-app JSX CSS Using no classes this project gives you a perfect entry point into functional react and will definitely help you in 2020. You can find the example project here: https://www.freecodecamp.org/news/how-to-build-a-movie-search-app-using-react-hooks-24eb72ddfaf7/ Follow along with the tutorial or give it your own flavor! Build a chat app with Vue Another great project for you is to build a chat app using my favorite JavaScript library VueJS. The app will look something like this: Example project Vue What you will learn Following this tutorial, you will learn how to set up a Vue app from scratch, creating components, handling state, creating route, connecting to a third party service and even handling authentication. Tech Stack & Features Vue Vuex Vue Router Vue CLI Pusher CSS This is really a great project to get started with Vue or to improve your existing skills to tackle development in 2020. You can find the tutorial right here: https://www.sitepoint.com/pusher-vue-real-time-chat-app/ Build a beautiful weather app with Angular 8 This example will help you to build a beautiful weather app using Google's Angular 8: Example project Angular What you will learn This project will teach you valuable skills such while creating an application from scratch, starting with the design over development all the way to a production-ready deployment. Tech Stack & Features Angular 8 Firebase Server-Side Rendering CSS with Grid Layout and Flexbox Mobile friendly & responsive Dark Mode Beautiful UI What I really, really like about this comprehensive project is that you do not learn things in isolation but the whole development process from the design to the final deployment. You should really do this one! https://medium.com/@hamedbaatour/build-a-real-world-beautiful-web-app-with-angular-6-a-to-z-ultimate-guide-2018-part-i-e121dd1d55e Build a to-do app with Svelte Svelte kinda is the new kid on the block compared to React, Vue, and Angular but nonetheless one of the hotties for 2020. Okay, To-Do apps are not necessarily the hottest topic out there but this will really help you to sharpen you Svelte skills and look like this: Example project Svelte What you will learn This tutorial will show you how to make an app using Svelte 3 from start to finish. It makes use of components, styling and event handlers Tech Stack & Features Svelte 3 Components Styling via CSS ES 6 syntax There aren't that many good Svelte starter projects out there so I find this one to be kinda good to start with. And who knows, maybe you are the one creating another, more comprehensive Svelte tutorial that will be presented in the next year's version of this post? https://medium.com/codingthesmartway-com-blog/building-a-svelte-3-todo-app-from-start-to-deployment-1737f72c23a6 Build an e-commerce shopping cart with Next.js NextJs is the most popular framework for creating React applications that support server-side rendering out of the box. This project will show you how to build an e-commerce shopping cart looking like this: Example project Next What you will learn In this project, you will learn how to set up a Next.js development environment, create new pages and components, fetch data, style, and deploy a next application. Tech Stack & Features Next.js Components and Pages Data Fetching Styling Deployment SSR and SPA It is always great to have a real-world example such as an e-commerce showcase to learn something new. You can find the tutorial here: https://snipcart.com/blog/next-js-ecommerce-tutorial Build a full-blown multi-language blog website Nuxt.js Nuxt.js is to Vue what Next.js is to react. A great framework to combine the power of server-side rendering and single-page applications. The final app that you could create will look like this: Example project Nuxt What you will learn This example project will teach you how to build a full-blown website using Nuxt.js from the initial setup to the final deployment. It makes use of many of the cool features Nuxt has to offer like pages and components as well as styling with SCSS. Tech Stack & Features Nuxt.js Components and Pages Storyblok module Mixins Vuex for state management SCSS for styling Nuxt middlewares This is a really cool project for you and covers many of the great features of Nuxt.js. I personally love working with Nuxt so you should really try this one out as it will also make you a better Vue developer! https://www.storyblok.com/tp/nuxt-js-multilanguage-website-tutorial Build a Blog with Gatsby Gatsby is a great static site generator that uses React and GraphQL under the hood. This is the result of this project: Example project Gatsby What you will learn In this tutorial, you will learn how to leverage Gatsby to build an outstanding blog that you could well use for writing your own articles while making use of React and GraphQL. Tech Stack & Features Gatsby React GraphQL Plugins & Themes MDX / Markdown Bootstrap CSS Templates If you ever wanted to start a blog this is a great example of how to do so leveraging React and GraphQL. I am not saying that Wordpress always is a bad choice but with Gatsby you can create highly performant sites while using React which is an awesome combination! https://blog.bitsrc.io/how-to-build-a-blog-with-gatsby-and-boostrap-d1270212b3dc Build a Blog with Gridsome Gridsome is to Vue...Okay, we already had that with Next/Nuxt but the same is true for Gridsome and Gatsby. Both use GraphQL as a data layer but Gridsome makes use of VueJS. It also is an awesome static site generator that will help you create great blogs: Example project Gridsome What you will learn This project will teach you how to build a simple blog to get started with Gridsome, GraphQL, and Markdown. It also covers how to deploy the application via Netlify. Tech Stack & Features Gridsome Vue GraphQL Markdown Netlify This for sure isn't the most comprehensive tutorial but covers the basic concepts of Gridsome and Markdown and could be a good starting point. https://www.telerik.com/blogs/building-a-blog-with-vue-and-markdown-using-gridsome Build a SoundCloud-like audio player app with Quasar Quasar is another Vue framework that can also be used to build mobile applications. In this project you will create an audio player app looking like this: Example project Quasar What you will learn While the other projects focus mainly on web applications this one will show you how to create a mobile app using Vue via the Quasar framework. You should already have a working Cordova setup with android studio / xcode configured. If not there is a link in the tutorial to the quasar website where they show you how to set this up. Tech Stack & Features Quasar Vue Cordova Wavesurfer UI Components A small project that shows the power of Quasar for building mobile apps. https://www.learningsomethingnew.com/how-to-build-a-sound-cloud-like-audio-player-app-with-vue-js-quasar-and-wave-surfer Conclusion In this article I showed you 9 projects that you can build, each focussing on another JavaScript framework or library. Now the choice is all yours: Will you try something new by using a framework you haven't used before? Or do you want to strengthen your skills by doing a project for a technology you already have some knowledge in? Or will you rely on your favorite framework/library and do all the projects in 2020 with it? Feel free to leave a comment and don't forget to follow me for more upcoming posts!
// Order matters when inserting CDN URLs into Kintone App settings
https://cdn.amcharts.com/lib/4/core.js
https://cdn.amcharts.com/lib/4/charts.js
https://cdn.amcharts.com/lib/4/plugins/wordCloud.js
https://cdn.amcharts.com/lib/4/themes/animated.js
(function () {
'use strict';
// Kintone event triggered after the record list page is displayed.
kintone.events.on('app.record.index.show', function (event) {
// Retrieve & configure the space element below the record list's header
var spaceDiv = kintone.app.getHeaderSpaceElement();
spaceDiv.style.height = '500px';
spaceDiv.style.marginLeft = '25px';
spaceDiv.style.marginRight = '25px';
spaceDiv.style.border = 'solid';
spaceDiv.style.borderColor = '#ED7B84';
// Creating chart instance
var chart = am4core.create(spaceDiv, am4plugins_wordCloud.WordCloud);
// Creating a series
var series = chart.series.push(new am4plugins_wordCloud.WordCloudSeries());
// Apply amCharts Themes for automatic animation
am4core.useTheme(am4themes_animated);
// Configuring the Word Cloud with Series Properties
// Checking for overlapping of words' Intensity level.
// (Lower value, slower, less overlap)
series.accuracy = 4;
// The number of steps a label is moved if its space is already occupied.
// (Lower value, more packed labels, consume more CPU)
series.step = 15;
// If word's relative height is bigger than the rotationThreshold, it won't be rotated.
// 0 = no words will rotate; 1 = all words will rotate
series.rotationThreshold = 0.7;
// Maximum number of words to show.
series.maxCount = 200;
// Minimum character length of a word to be included
series.minWordLength = 2;
// Font size for the biggest words in numeric pixel size or relative as Percent.
series.maxFontSize = am4core.percent(30);
// Auto-assigning colors from theme list
series.colors = new am4core.ColorSet();
// Keeps the words' color the same as it rotates
series.colors.passOptions = {};
// Array of possible word rotation angles.
// (0 = horizontal, 90 = vertical)
series.angles = [0, -90];
// Text's font weight
series.fontWeight = '700';
// Set element's four margins at once by pixel (top, right, bottom, left)
series.labels.template.margin(4, 4, 4, 4);
// Display the word's count when hovering over with a mouse
series.labels.template.tooltipText = '{word}: [bold]{value}[/]';
// Filter out function word
var stopWords = ['A', 'A\'s', 'Able', 'About', 'Above', 'According', 'Accordingly', 'Across', 'Actually', 'After', 'Afterwards', 'Again', 'Against', 'Ain\'t', 'All', 'Allow', 'Allows', 'Almost', 'Alone', 'Along', 'Already', 'Also', 'Although', 'Always', 'Am', 'Among', 'Amongst', 'An', 'And', 'Another', 'Any', 'Anybody', 'Anyhow', 'Anyone', 'Anything', 'Anyway', 'Anyways', 'Anywhere', 'Apart', 'Appear', 'Appreciate', 'Appropriate', 'Are', 'Aren\'t', 'Around', 'As', 'Aside', 'Ask', 'Asking', 'Associated', 'At', 'Available', 'Away', 'Awfully', 'B', 'Be', 'Became', 'Because', 'Become', 'Becomes', 'Becoming', 'Been', 'Before', 'Beforehand', 'Behind', 'Being', 'Believe', 'Below', 'Beside', 'Besides', 'Best', 'Better', 'Between', 'Beyond', 'Both', 'Brief', 'But', 'By', 'C', 'C\'mon', 'C\'s', 'Came', 'Can', 'Can\'t', 'Cannot', 'Cant', 'Cause', 'Causes', 'Certain', 'Certainly', 'Changes', 'Clearly', 'Co', 'Com', 'Come', 'Comes', 'Concerning', 'Consequently', 'Consider', 'Considering', 'Contain', 'Containing', 'Contains', 'Corresponding', 'Could', 'Couldn\'t', 'Course', 'Currently', 'D', 'Definitely', 'Described', 'Despite', 'Did', 'Didn\'t', 'Different', 'Do', 'Does', 'Doesn\'t', 'Doesn', 'Doing', 'Don\'t', 'Done', 'Down', 'Downwards', 'During', 'E', 'Each', 'Edu', 'Eg', 'Eight', 'Either', 'Else', 'Elsewhere', 'Enough', 'Entirely', 'Especially', 'Et', 'Etc', 'Even', 'Ever', 'Every', 'Everybody', 'Everyone', 'Everything', 'Everywhere', 'Ex', 'Exactly', 'Example', 'Except', 'F', 'Far', 'Few', 'Fifth', 'First', 'Five', 'Followed', 'Following', 'Follows', 'For', 'Former', 'Formerly', 'Forth', 'Four', 'From', 'Further', 'Furthermore', 'G', 'Get', 'Gets', 'Getting', 'Given', 'Gives', 'Go', 'Goes', 'Going', 'Gone', 'Got', 'Gotten', 'Greetings', 'H', 'Had', 'Hadn\'t', 'Happens', 'Hardly', 'Has', 'Hasn\'t', 'Have', 'Haven\'t', 'Having', 'He', 'He\'s', 'Hello', 'Help', 'Hence', 'Her', 'Here', 'Here\'s', 'Hereafter', 'Hereby', 'Herein', 'Hereupon', 'Hers', 'Herself', 'Hi', 'Him', 'Himself', 'His', 'Hither', 'Hopefully', 'How', 'Howbeit', 'However', 'I', 'I\'d', 'I\'ll', 'I\'m', 'I\'ve', 'Ie', 'If', 'Ignored', 'Immediate', 'In', 'Inasmuch', 'Inc', 'Indeed', 'Indicate', 'Indicated', 'Indicates', 'Inner', 'Insofar', 'Instead', 'Into', 'Inward', 'Is', 'Isn\'t', 'It', 'It\'d', 'It\'ll', 'It\'s', 'Its', 'Itself', 'J', 'Just', 'K', 'Keep', 'Keeps', 'Kept', 'Know', 'Known', 'Knows', 'L', 'Last', 'Lately', 'Later', 'Latter', 'Latterly', 'Least', 'Less', 'Lest', 'Let', 'Let\'s', 'Like', 'Liked', 'Likely', 'Little', 'Look', 'Looking', 'Looks', 'Ltd', 'M', 'Mainly', 'Many', 'May', 'Maybe', 'Me', 'Mean', 'Meanwhile', 'Merely', 'Might', 'More', 'Moreover', 'Most', 'Mostly', 'Much', 'Must', 'My', 'Myself', 'N', 'Name', 'Namely', 'Nd', 'Near', 'Nearly', 'Necessary', 'Need', 'Needs', 'Neither', 'Never', 'Nevertheless', 'New', 'Next', 'Nine', 'No', 'Nobody', 'Non', 'None', 'Noone', 'Nor', 'Normally', 'Not', 'Nothing', 'Novel', 'Now', 'Nowhere', 'O', 'Obviously', 'Of', 'Off', 'Often', 'Oh', 'Ok', 'Okay', 'Old', 'On', 'Once', 'One', 'Ones', 'Only', 'Onto', 'Or', 'Other', 'Others', 'Otherwise', 'Ought', 'Our', 'Ours', 'Ourselves', 'Out', 'Outside', 'Over', 'Overall', 'Own', 'P', 'Particular', 'Particularly', 'Per', 'Perhaps', 'Placed', 'Please', 'Plus', 'Possible', 'Presumably', 'Probably', 'Provides', 'Q', 'Que', 'Quite', 'Qv', 'R', 'Rather', 'Rd', 'Re', 'Really', 'Reasonably', 'Regarding', 'Regardless', 'Regards', 'Relatively', 'Respectively', 'Right', 'S', 'Said', 'Same', 'Saw', 'Say', 'Saying', 'Says', 'Second', 'Secondly', 'See', 'Seeing', 'Seem', 'Seemed', 'Seeming', 'Seems', 'Seen', 'Self', 'Selves', 'Sensible', 'Sent', 'Serious', 'Seriously', 'Seven', 'Several', 'Shall', 'She', 'Should', 'Shouldn\'t', 'Since', 'Six', 'So', 'Some', 'Somebody', 'Somehow', 'Someone', 'Something', 'Sometime', 'Sometimes', 'Somewhat', 'Somewhere', 'Soon', 'Sorry', 'Specified', 'Specify', 'Specifying', 'Still', 'Sub', 'Such', 'Sup', 'Sure', 'T', 'T\'s', 'Take', 'Taken', 'Tell', 'Tends', 'Th', 'Than', 'Thank', 'Thanks', 'Thanx', 'That', 'That\'s', 'Thats', 'The', 'Their', 'Theirs', 'Them', 'Themselves', 'Then', 'Thence', 'There', 'There\'s', 'Thereafter', 'Thereby', 'Therefore', 'Therein', 'Theres', 'Thereupon', 'These', 'They', 'They\'d', 'They\'ll', 'They\'re', 'They\'ve', 'Think', 'Third', 'This', 'Thorough', 'Thoroughly', 'Those', 'Though', 'Three', 'Through', 'Throughout', 'Thru', 'Thus', 'To', 'Together', 'Too', 'Took', 'Toward', 'Towards', 'Tried', 'Tries', 'Truly', 'Try', 'Trying', 'Twice', 'Two', 'U', 'Un', 'Under', 'Unfortunately', 'Unless', 'Unlikely', 'Until', 'Unto', 'Up', 'Upon', 'Us', 'Use', 'Used', 'Useful', 'Uses', 'Using', 'Usually', 'Uucp', 'V', 'Value', 'Various', 'Very', 'Via', 'Viz', 'Vs', 'W', 'Want', 'Wants', 'Was', 'Wasn\'t', 'Way', 'We', 'We\'d', 'We\'ll', 'We\'re', 'We\'ve', 'Welcome', 'Well', 'Went', 'Were', 'Weren\'t', 'What', 'What\'s', 'Whatever', 'When', 'Whence', 'Whenever', 'Where', 'Where\'s', 'Whereafter', 'Whereas', 'Whereby', 'Wherein', 'Whereupon', 'Wherever', 'Whether', 'Which', 'While', 'Whither', 'Who', 'Who\'s', 'Whoever', 'Whole', 'Whom', 'Whose', 'Why', 'Will', 'Willing', 'Wish', 'With', 'Within', 'Without', 'Won\'t', 'Wonder', 'Would', 'Wouldn\'t', 'X', 'Y', 'Yes', 'Yet', 'You', 'You\'d', 'You\'ll', 'You\'re', 'You\'ve', 'Your', 'Yours', 'Yourself', 'Yourselves', 'Z', 'Zero'];
// Append Lowercase and Uppercase versions
var excludeArray = stopWords.concat(
stopWords.map(function (lower) {
return lower.toLowerCase();
}), stopWords.map(function (upper) {
return upper.toUpperCase();
})
);
series.excludeWords = excludeArray;
// Import the string from Kintone's Text Area field
var words;
words = event.records.reduce(function (accumulator, current) {
// Content default field code = Text_area
return accumulator += current.Text_area.value;
});
// Insert the string into series
series.text = words;
// - - - - - Extra Functionality - - - - -
// Enable export
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.backgroundColor = am4core.color('#f00', 0);
// - - - - - - - - - - - - - - -
// Optional Settings:
/* Following are optional settings that you can take advantage of by uncommenting them */
// Display value along side the word
/*
series.labels.template.text = "{word}: {value}";
*/
// Rotate the Word Cloud by 45 degrees
/*
series.labelsContainer.rotation = 45;
series.events.on("arrangestarted", function (ev) {
ev.target.baseSprite.preloader.show(0);
});
*/
// Display progress indicator
/*
series.events.on("arrangeprogress", function (ev) {
ev.target.baseSprite.preloader.progress = ev.progress;
});
*/
});
})();

Thank you for attending our workshop!

Your Feedback Please

Please fill out this quick survey for a chance to win $25 Amazon Gift Card:

Next Step

For those wanting more visualization projects:

  • Try linking to different amChart libraries, and reuse the code we used in the workshop!

For those wanting to create projects on Kintone and want to retrieve & store data from public APIs:

For those wanting to use Kintone as a back-end database:

Where to Get Help?

(function () {
'use strict';
var url = "https://xkcd.com/327/info.0.json";
kintone.events.on('app.record.index.show', function (event) {
kintone.proxy(url, 'GET', {}, {}, function (success) {
var jsonResponse = JSON.parse(success);
console.log(jsonResponse);
window.open(jsonResponse.img, "", "width=800, height=200, top=200");
}, function (error) {
console.log(error);
});
return event;
});
})();
Display the source blob
Display the rendered blob
Raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment