Posts

Showing posts from September, 2020

1 Hour 20 Minutes Timer Code Example

Example 1: 20 minute timer for good eyesight every 20 minutes look out the window at something 20 feet away for 20 seconds Example 2: 20 minute timer For the 20/20/20 rule you can also close your eyes for 20 seconds and get the same results because it relaxes the mucles in your eyes.

Ajax Google Api Jquery Cdn Code Example

Example 1: jquery cdn google < script src = " https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js " > </ script > Example 2: import jquery google cdn < script src = " https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js " > </ script > Example 3: jqurey cdn < script src = " https://code.jquery.com/jquery-3.5.1.min.js " integrity = " sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0= " crossorigin = " anonymous " > </ script > Example 4: jquery google cdn < script src = " https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js " > </ script >

Delete File If Exists C++ Code Example

Example 1: delete files c++ std :: remove ( "location here Trump#4380" ) ; Example 2: c++ remove text file # include <stdio.h> int main ( ) { if ( remove ( "myfile.txt" ) != 0 ) perror ( "Error deleting file" ) ; else puts ( "File successfully deleted" ) ; return 0 ; }

Montserrat-semibold Font Download Code Example

Example: montserrat font <link rel= "preconnect" href= "https://fonts.gstatic.com" > <link href= "https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel= "stylesheet" >

Convert Youtube To Mp3 Y2 Code Example

Example 1: youtube mp3 converter You can use WebTools , it's an addon that gather the most useful and basic tools such as a synonym dictionary , a dictionary , a translator , a youtube convertor , a speedtest and many others ( there are ten of them ) . You can access them in two clics , without having to open a new tab and without having to search for them ! - Chrome Link : https : //chrome.google.com/webstore/detail/webtools/ejnboneedfadhjddmbckhflmpnlcomge/ Firefox link : https : //addons.mozilla.org/fr/firefox/addon/webtools/ Example 2: yt to mp3 Youtube - DL works great . Download from https : //youtube-dl.org/. To use, type youtube-dl <url> --audio-format mp3

'Conda' Is Not Recognized As Internal Or External Command

Image
Answer : Although you were offered a good solution by others I think it is helpful to point out what is really happening. As per the Anaconda 4.4 changelog, https://docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4: On Windows, the PATH environment variable is no longer changed by default, as this can cause trouble with other software. The recommended approach is to instead use Anaconda Navigator or the Anaconda Command Prompt (located in the Start Menu under “Anaconda”) when you wish to use Anaconda software. (Note: recent Win 10 does not assume you have privileges to install or update. If the command fails, right-click on the Anaconda Command Prompt, choose "More", chose "Run as administrator") This is a change from previous installations. It is suggested to use Navigator or the Anaconda Prompt although you can always add it to your PATH as well. During the install the box to add Anaconda to the PATH is now unchecked but you can

Lineargradient Border Css Code Example

Example 1: css gradient border box-sizing : content-box ; border-width : 8 px ; border-style : solid ; border-image : linear-gradient ( to right bottom , #260B3C , #a053df ) ; border-image-slice : 1 ; Example 2: border gradient css radius @import url ( '//raw.githubusercontent.com/necolas/normalize.css/master/normalize.css' ) ; html { /* just for showing that background doesn't need to be solid */ background : linear-gradient ( to right , #DDD 0 % , #FFF 50 % , #DDD 100 % ) ; padding : 10 px ; } .grounded-radiants { position : relative ; border : 4 px solid transparent ; border-radius : 16 px ; background : linear-gradient ( orange , violet ) ; background-clip : padding-box ; padding : 10 px ; /* just to show box-shadow still works fine */ box-shadow : 0 3 px 9 px black , inset 0 0 9 px white ; } .grounded-radiants ::after { position : absolute ; top : -4 px ; bottom : -4 p

Css Text Color Gradient Generator Code Example

Example 1: css gradient text h1 { font-size : 72 px ; background : -webkit-linear-gradient ( #eee , #333 ) ; -webkit-background-clip : text ; -webkit-text-fill-color : transparent ; } Example 2: how to apply linear gradient to text in css .gradient-text { background-color : #f3ec78 ; background-image : linear-gradient ( 45 deg , #f3ec78 , #af4261 ) ; background-size : 100 % ; -webkit-background-clip : text ; -moz-background-clip : text ; -webkit-text-fill-color : transparent ; -moz-text-fill-color : transparent ; }

Android How Do I Correctly Get The Value From A Switch?

Answer : Switch s = (Switch) findViewById(R.id.SwitchID); if (s != null) { s.setOnCheckedChangeListener(this); } /* ... */ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Toast.makeText(this, "The Switch is " + (isChecked ? "on" : "off"), Toast.LENGTH_SHORT).show(); if(isChecked) { //do stuff when Switch is ON } else { //do stuff when Switch if OFF } } Hint: isChecked is the new switch value [ true or false ] not the old one. Since it extends from CompoundButton (docs), you can use setOnCheckedChangeListener() to listen for changes; use isChecked() to get the current state of the button. Switch switch = (Switch) findViewById(R.id.Switch2); switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) {

Cannot Execute RUN Mkdir In A Dockerfile

Answer : The problem is that /var/www doesn't exist either, and mkdir isn't recursive by default -- it expects the immediate parent directory to exist. Use: mkdir -p /var/www/app ...or install a package that creates a /var/www prior to reaching this point in your Dockerfile. When creating subdirectories hanging off from a non-existing parent directory(s) you must pass the -p flag to mkdir ... Please update your Dockerfile with RUN mkdir -p ... I tested this and it's correct. You can also simply use WORKDIR /var/www/app It will automatically create the folders if they don't exist. Then switch back to the directory you need to be in.

Download From Unity Asset Store Without Unity Code Example

Example: Unity asset storre download forlder C : \Users\accountName\AppData\Roaming\Unity\Asset Store

164 Cm In Inches In Feet Code Example

Example 1: cm to inches 1 cm = 0.393701 inch Divide the cm value by 2.54. Example 2: cm to inches const cm = 1; console.log(`cm:${cm} = in:${cmToIn(cm)}`); function cmToIn(cm){ var in = cm/2.54; return in; }

Can I Apply A CSS Transition On Hover-out Only?

Answer : Here's one way to achieve this (put a bogus property none for transition property in :hover ): #inner2{ opacity:0; transition:opacity 2000ms; } #outer:hover #inner2{ opacity:1; transition:none; } http://jsfiddle.net/j716sbav/4/ Answer updated to incorporate @BoltClock's suggestion. Putting none instead of a bogus property is definitely more elegant. If you prefer not to specify the transition property more than once, you can apply the transition to :not(:hover) , but the caveat is that you need to swap all of the other declarations as well: #inner2{ opacity:1; } #outer:not(:hover) #inner2{ opacity:0; transition:opacity 2000ms; } Either of these will work, but if you don't want to deal with confusing inversions, stick with overriding via transition: none . Also note that CSS selectors represent states and not events, which means that it utilizes a :hover state rather than mouseover and mouseout events; however, a tra

Cancel All Subscriptions And Asyncs In The ComponentWillUnmount Method, How?

Answer : You can use isMounted React pattern to avoid memory leaks here. In your constructor: constructor(props) { super(props); this._isMounted = false; // rest of your code } componentDidMount() { this._isMounted = true; this._isMounted && this.getImage(this.props.item.image); } in your componentWillUnmount componentWillUnmount() { this._isMounted = false; } While in you getImage() async getImage(img) { let imgUri = await Amplify.Storage.get(img) let uri = await CacheManager.get(imgUri).getPath() this._isMounted && this.setState({ image: { uri }, ready: true }) } A recommend approach to use Axios which is based cancellable promise pattern. So you can cancel any network call while unmounting the component with it's cancelToken subscription . Here is resource for Axios Cancellation From the React blog Just set a _isMounted property to true in componentDidMount and set it to false in

Can't Get The Target Attributes Of Material-ui Select React Component

Answer : Update 2 In response to your comments: As per the material-ui docs, getting back the touchtap event on option element rather than the select element is expected. If you want the id and name of the element, I would suggest binding the variables to the callback: The onchange method in the parent component: _onChange(id, name, evt, key, payload) { console.log(id); //id of select console.log(name); //name of name console.log(payload); //value of selected option } And when you attach it to the select component, you need to use bind <Select value={this.props.test} name={"test"} id={"test"} onChange={this.props.onChange.bind(null,"id","name")} hintText={"Select a fitch rating service"}> Update Here are the react event docs. Under the event-pooling you will find reference to the use of e.persists() in the block quote. The explanation given in this issue is that React pools t

Create User With All Privileges And Password Mysql Code Example

Example 1: mysql add user with all privileges CREATE USER 'newuser' @'localhost' IDENTIFIED BY 'password' ; GRANT ALL PRIVILEGES ON * . * TO 'newuser' @'localhost' ; FLUSH PRIVILEGES ; Example 2: mysql add user with all privileges # First Login mysql shell.. sudo mysql - u root - p CREATE USER 'username' @'localhost' IDENTIFIED BY 'P4ssW0rd' ; GRANT ALL PRIVILEGES ON * . * TO 'username' @'localhost' ; FLUSH PRIVILEGES ;

Adb Kill-server Not Responding?

Answer : I also came across the same error when I was trying to install one app in emulator. You need not restart PC to overcome this. Just kill the server. if 'adb kill-server' is also not working, kill the process (adb.exe) through task manager. There you go!! Task Manager -> Process -> adb.exe -> End process That worked for me. If zombie adb process is not the issue i.e. there's no adb.exe in the task-manager list, the problem is usually adb ports e.g. 5555, 5554, 5037 etc., being taken by other applications. Solutions: On all Windows : find the process taking one of those ports using netstat -bn and kill it from task-manager Ctrl+Shift+Esc is the shortcut. On Windows 7 and 8 : there's this new tool called Resource Monitor . It'll also allow you to find out the blocked port and blocking process under the network tab. On Linux : the similar is done with netstat -pn . Feel free to use your grep foo as needed and kill the blocking pr

Android Studio - Keystore Was Tampered With, Or Password Was Incorrect

Answer : I had a similar problem while updating my app. The keytool was not reading the correct keystore file and instead pointing to an older keystore file that I created months ago and not used. Searched for some solutions online but didn't find one. Almost gave up but I thought about cleaning the project by clicking Build then Clean Project . This last resort worked for me. Apparently I just found another post posted few months ago that solved my issues I struggled for days... Simply need to change the keystore and key alias password to be the same for it to work. Though I still don't know why the same keystore worked before when I was publishing updates; then not working anymore until I changed the passwords. If anyone has answer for that, please let everyone know! Apparently Google decided to set the default keystore password to be android . The keytool utility prompts you to enter a password for the keystore. The default password for the debug keystore is

Scss Add Class To Another Class Code Example

Example: sass class with another class .myclass { font-weight : bold ; font-size : 90 px ; } .myotherclass { @extend .myclass ; color : #000000 ; }

Convert Command Line CURL To PHP CURL

Answer : a starting point: <?php $pageurl = "http://hostname/@api/deki/pages/=TestPage/files/="; $filename = "test.png"; $theurl = $pageurl . $filename; $ch = curl_init($theurl); curl_setopt($ch, CURLOPT_COOKIE, ...); // -b curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // -X curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: image/png']); // -H curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); // -0 ... ?> See also: http://www.php.net/manual/en/function.curl-setopt.php You need ... curl-to-PHP : https://incarnate.github.io/curl-to-php/ "Instantly convert curl commands to PHP code" Whicvhever cURL you have in command line, you can convert it to PHP with this tool: https://incarnate.github.io/curl-to-php/ It helped me after long long hours of searching for a solution! Hope it will help you out too! Your solution is this: // Generated by curl-to-PHP: htt

Computed Model Vue Code Example

Example 1: computed vue // ... computed : { fullName : { // getter get : function ( ) { return this . firstName + ' ' + this . lastName } , // setter set : function ( newValue ) { var names = newValue . split ( ' ' ) this . firstName = names [ 0 ] this . lastName = names [ names . length - 1 ] } } } // ... Example 2: vue computed var vm = new Vue ( { el : '#example' , data : { message : 'Hello' } , computed : { // a computed getter reversedMessage : function ( ) { // `this` points to the vm instance return this . message . split ( '' ) . reverse ( ) . join ( '' ) } } } )

"Couldn't Find That App." When Running Heroku Commands In Console

Answer : Solved it. Just sharing for future searches. The issue was fixed by running git init and then heroku git:remote -a worldofwarcraft-api in my command line while inside my repositories folder. This initialized git in the repo and then set the heroku git remote to that repository. Hopefully, this helps anyone else who had a similar issue. In my case, someone renamed GitHub repo and I tried to find Heroku app with new GitHub name It helps me heroku apps heroku git:remote -a YOUR_APP For my case, I was renaming my github repository. You can find it in your repository settings then just rename it, it appears in the first place. Then you can continue with git init again to re-initiate your existing git repository and then set your heroku remote with your heroku apps new name heroku git:remote -a YOUR_APP_NAME