Posts

Showing posts from October, 2002

Create New React Component Code Example

Example 1: create react component class class MyComponent extends React . Component { constructor ( props ) { super ( props ) ; } ; render ( ) { return ( < div > < h1 > My First React Component ! < / h1 > < / div > ) ; } } ; Example 2: how to create component in reactjs class Car extends React . Component { render ( ) { return < h2 > Hi , I am a Car ! < / h2 > ; } } Example 3: functional components react function Comment ( props ) { return ( < div className = "Comment" > < div className = "UserInfo" > < img className = "Avatar" src = { props . author . avatarUrl } alt = { props . author . name } / > < div className = "UserInfo-name" > { props . author . name } &l

Add Border To A Container With BorderRadius In Flutter

Image
Answer : It's not possible to add border: and borderRadius: at the same time, you'll get this error: A borderRadius can only be given for uniform borders. You can achieve what you want using the borderRadius: and a boxShadow: instead of border: like this: boxShadow: [ BoxShadow(color: Colors.green, spreadRadius: 3) ] Your sample code would be like this: Container( child: Text( 'This is a Container', textScaleFactor: 2, style: TextStyle(color: Colors.black), ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.white, boxShadow: [ BoxShadow(color: Colors.green, spreadRadius: 3), ], ), height: 50, ), Edit: To achieve the example you now provided, you could do this: Container( padding: EdgeInsets.only(left: 12.0), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.0), color: Colors.green, ), height: 50, child: Container( decoration: BoxD

Fontawesome 4 Cdn Code Example

Example 1: fontawesome cdn <link href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel= "stylesheet" > Example 2: font awesome 4.7 cdn <link rel= "stylesheet" href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity= "sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin= "anonymous" /> Example 3: font awesome 4 cdn <!-- Fontawesome 4 Cdn from BootstrapCDN --> <link rel= "stylesheet" type= "text/css" href= "https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" > Example 4: bootstrap font asesome cdn The correct one -> Give an upvote if it helps <link rel= "stylesheet" href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" /> Example 5: fontawesome cdn gem 'font-awesome-sass&#

Can I Hex Edit A File In Visual Studio?

Answer : Menu File → Open → File Select the file to be opened On the open file dialog at the bottom there is a down arrow on the "Open" button Click "Open With..." Click "Binary Editor" Click OK Or for the keyboard geeks out there: Ctrl + o Ctrl + v (paste filename) tab tab ↓ w b Enter In addition to Kevin's answer, with Visual Studio 2017 you need to have the Visual Studio C++ Core Features component installed. Source

How To Animate Unity And Play Animation Unity Code Example

Example 1: how to play animation with code in unity public GameObject ExampleNPC ; void Update ( ) { if ( Input . GetButtonDown ( "Animation" ) ) // Make sure to refrence this in Input settings { ExampleNPC . GetComponent < Animator > ( ) . Play ( "Anim name" ) ; } } Example 2: play animation through script unity animator . Play ( "StateName" ) ;

Tailwind Css Svg Fill Color Code Example

Example 1: darken image css .container img { filter : brightness ( 50 % ) ; } Example 2: tailwind svg color <svg class= "fill-current text-green-600 ..." ></svg>

CSS Fill Remaining Width

Answer : Use calc ! https://jsbin.com/wehixalome/edit?html,css,output HTML: <div class="left"> 100 px wide! </div><!-- Notice there isn't a space between the divs! *see edit for alternative* --><div class="right"> Fills width! </div> CSS: .left { display: inline-block; width: 100px; background: red; color: white; } .right { display: inline-block; width: calc(100% - 100px); background: blue; color: white; } Update: As an alternative to not having a space between the divs you can set font-size: 0 on the outer element. You can realize this layout using CSS table-cells. Modify your HTML slightly as follows: <div id="header"> <div class="container"> <div class="logoBar"> <img src="http://placehold.it/50x40" /> </div> <div id="searchBar"> <input type="text" /&g

Flex Wrap Text React Native Code Example

Example: react native text wrap <View style= { { flexDirection : 'row' } } > <Text style= { { flexShrink : 1 } } > Really really long text... </Text> </View>

Hide Scroll Bar But Still Scroll Css Code Example

Example 1: hide scrollbar css /* Hide scrollbar for Chrome, Safari and Opera */ .scrollbar-hidden ::-webkit-scrollbar { display : none ; } /* Hide scrollbar for IE, Edge add Firefox */ .scrollbar-hidden { -ms-overflow-style : none ; scrollbar-width : none ; /* Firefox */ } Example 2: css hide scrollbar but allow scroll html { overflow : scroll ; } ::-webkit-scrollbar { width : 0 px ; background : transparent ; /* make scrollbar transparent */ } Example 3: hide scrollbar css /* A very quick an applicable solution is to use this piece of code: */ html { overflow : scroll ; overflow-x : hidden ; } ::-webkit-scrollbar { width : 0 px ; /* remove scrollbar space / background: transparent; / optional: just make scrollbar invisible / } / optional: show position indicator in red */ ::-webkit-scrollbar-thumb { background : #FF0000 ; } Example 4: how to make scrollbar hidden overflow : hidden ;

Android SQLite Auto Increment

Answer : Make it INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL . Here's what the docs say: If a column has the type INTEGER PRIMARY KEY AUTOINCREMENT then... the ROWID chosen for the new row is at least one larger than the largest ROWID that has ever before existed in that same table. The behavior implemented by the AUTOINCREMENT keyword is subtly different from the default behavior. With AUTOINCREMENT, rows with automatically selected ROWIDs are guaranteed to have ROWIDs that have never been used before by the same table in the same database. And the automatically generated ROWIDs are guaranteed to be monotonically increasing. SQLite AUTOINCREMENT is a keyword used for auto incrementing a value of a field in the table. We can auto increment a field value by using AUTOINCREMENT keyword when creating a table with specific column name to auto incrementing it. The keyword AUTOINCREMENT can be used with INTEGER field only. Syntax: The basic usage of AU

Bootstrap Text On Image Code Example

Example 1: bootstrap left image right text < div class = " card " > < div class = " row no-gutters " > < div class = " col-auto " > < img src = " //placehold.it/200 " class = " img-fluid " alt = " " > </ div > < div class = " col " > < div class = " card-block px-2 " > < h4 class = " card-title " > Title </ h4 > < p class = " card-text " > Description </ p > < a href = " # " class = " btn btn-primary " > BUTTON </ a > </ div > </ div > </ div > < div class = " card-footer w-100 text-muted " > Footer stating cats are CUTE little animals

Camera.lookat Unity Code Example

Example: unity look at target transform . LookAt ( target . transform . position ) ;

Convert String To Securestring Uipath Code Example

Example: uipath secure string to string // this will convert a secure string to a string String plainStr = new System.Net.NetworkCredential(string.Empty, secureStr).Password

How To Set Default Value In Input Field In Angular 6 Code Example

Example: how to set default value in input field in angularjs <input ng-model= "searchText" ng-init= "searchText ='can you see me'" ></input>

Border-radius Circle Code Example

Example 1: css circle border .circle { background-color : #fff ; border : 1 px solid red ; height : 100 px ; border-radius : 50 % ; -moz-border-radius : 50 % ; -webkit-border-radius : 50 % ; width : 100 px ; } <div class= "circle" ></div> Example 2: css border radius -webkit-border-radius : 5 px ; -moz-border-radius : 5 px ; border-radius : 5 px ;

How To Make A Space In Css Code Example

Example 1: word spacing css .classname { word-spacing : *px } Example 2: how to create space inbetween text css <div style= "letter-spacing: 1em;" >It's a wide wide word!</div> <div style= "line-height: 1.5;" > <div style= "text-indent: 50px;" >