31 May 2020

Override Bootstrap Styles (without !important)

<link href="bootstrap.min.css" rel="stylesheet">
<link href="custom.css" rel="stylesheet">

100 points for IDs 
10 points for classes and pseudo-classes 
1 point for tag selectors and pseudo-elements

<body id="bootstrap-overrides">

/* Example selector defined in Bootstrap */ 

.jumbotron h1
/* 10+1=11 priority scores */
line-height: 1; 
color: inherit; 

/* Your initial take at styling */ 
h1 {
/* 1 priority score, not enough to override Bootstrap jumbotron definition */ 
line-height: 1; 
color: inherit; 

/* New way of prioritization */ 
#bootstrap-overrides h1
/* 100+1=101 priority score, yay! */ 
line-height: 1; 
color: inherit; 
}

29 May 2020

React. Starting a New Project

New Project
Use either one of the below commands:

npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app


If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.

npx create-react-app my-app
cd my-app
npm start


https://create-react-app.dev/docs/getting-started/

Bootstrap
npm install react-bootstrap bootstrap

Redux
npm install react-redux

9 May 2020

C++. Include file. File Path

If the directory is in another path, you'll have to qualify the pathname. remember that .. goes one directory up. so, let's say the cpp file is in directory "myproject/a/source.cpp" and event.h is in "myproject/b/event.h". Your include would look like this:

#include "../b/event.h"

Popular Posts