Skip to content

CollegeStash

  • Software Engineer Interview Prep
  • System Design
  • Frontend
  • Contact
  • Search
  • CSS Margins Collapsing

    CSS Vertical Margins  of adjoining elements collapse vertically by default unless contained in a flexbox.

    CSS Horizontal Margins never collapse.

    (more…)

    August 25, 2018
  • Frog Jump – Java

    This solution uses a HashMap (more…)

    August 25, 2018
  • Flexbox – Div at end of row

    The following lines of code demonstrate how to align a div at the end of the flexbox row when you want to display the rest of the them at the start.
    flexbox
    (more…)

    June 8, 2018
  • Unit testing method called with parameters

    The following two unit tests demonstrate the scenario where you would want to write a unit test to verify whether a method was called with the required parameters. It also tests how many times a method was invoked by passing a mock method.

    (more…)

    June 7, 2018
  • Allow arrow functions as properties in React Components using eslint

    If you don’t configure your .eslintrc file, then you might see this “Parsing error: Unexpected token =” when you do the following in your react components.

    class HomeComponent extends Component {
      
      state = {
        term: '',
      };
    
      setTerm = (term) => {
        this.setState({ term });
      };
    
      ...
    }

    To use arrow functions as properties in React components you can do the following. (more…)

    June 7, 2018
  • Add Stylelint to webpack

    Adding stylelint to your project has many advantages that range from being able to throw warnings and errors when the styling rules (CSS, SASS-SCSS) are broken, to being able to fix most of your warnings automatically with a single command. (more…)

    March 30, 2018
  • How to create an arrow content separator in CSS

    Lets say you want to draw something similar to the following using only CSS. (more…)

    March 24, 2018
  • Format currency and date manually in Javascript

    Format Currency

    In case you want to implement a function to format currency instead of just using toLocaleString() then, you can use the following. (more…)

    March 2, 2018
  • Java Objects, Arrays – Pass by Reference?

    The array reference here is passed by value to the methods below. This is similar to what we usually see in case of Javascript. (more…)

    February 27, 2018
  • Material Modal using CSS3

    The following code tries to mimic the look and feel of the modal from Google’s Material Design using CSS3.

    (more…)

    February 10, 2018
←Previous Page
1 … 12 13 14 15 16 … 28
Next Page→