Posts

Showing posts from July, 2016
Note This plugin is part of the community.grafana collection (version 1.1.0). To install it use: ansible-galaxy collection install community.grafana . To use it in a playbook, specify: community.grafana.grafana_plugin . Synopsis Parameters Examples Return Values Synopsis Install and remove Grafana plugins. See https://grafana.com/docs/plugins/installation/ for upstream documentation. Parameters Parameter Choices/Defaults Comments grafana_plugin_url string Full URL to the plugin zip file instead of downloading the file from https://grafana.com/api/plugins. Requires grafana 4.6.x or later. grafana_plugins_dir string Directory where the Grafana plugin will be installed. If omitted, defaults to /var/lib/grafana/plugins . grafana_repo string URL to the Grafana plugin repository. If omitted, grafana-cli will use the default value: https://grafana.com/api/plugins. name string / required Name of the plugin. s

Check If Property Exists Javascript Code Example

Example 1: How to tell if an attribute exists on an object const user = { name : "Sicrano" , age : 14 } user . hasOwnProperty ( 'name' ) ; // Retorna true user . hasOwnProperty ( 'age' ) ; // Retorna true user . hasOwnProperty ( 'gender' ) ; // Retorna false user . hasOwnProperty ( 'address' ) ; // Retorna false Example 2: how to check wether the property exist in a object in java script if ( obj . hasOwnProperty ( 'prop' ) ) { // do something } Example 3: check the properties of an object in javascript for ( var name in object ) { if ( object . hasOwnProperty ( name ) ) { // do something with name } } // OR const hero = { name : 'Batman' } ; hero . hasOwnProperty ( 'name' ) ; // => true hero . hasOwnProperty ( 'realName' ) ; // => false Example 4: javascript does object have pr

Change Vue Prototype Variable In All Components

Answer : To have $color globally available, you can use a Mixin , more specifically a Global Mixin . If you would only want it to be read-only, it is simplest solution (less code). See snippet: Vue.mixin({ created: function () { this.$color = 'green'; } }) new Vue({ el: '#app1', data: { message: 'Hello Vue.js!' }, mounted() { console.log('$color #app1:', this.$color); } }) new Vue({ el: '#app2', data: { message: 'Hello Vue.js!' }, mounted() { console.log('$color #app2:', this.$color); } }) <script src="https://unpkg.com/vue@2.5.15/dist/vue.min.js"></script> <div id="app1"> <p>app1: {{ message }}</p> </div> <div id="app2"> <p>app2: {{ message }}</p> </div> Making $color reactive To mave Vue react everywhere to changes to $color , you could use a Vuex store (see other answe

Bleacher Report Buccaneers Code Example

Example: bleacher report tampa bay bucs [...Array(10).keys()] //=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Fas Facebook Code Example

Example 1: fa fa-facebook < i class = "fa fa-facebook-square" aria - hidden = "true" > < / i > Example 2: font awesome facebook Font Awesome 5 : Letter F : < i class = "fab fa-facebook-f" > < / i > Round : < i class = "fab fa-facebook" > < / i > Square : < i class = "fab fa-facebook-square" > < / i > Messenger : < i class = "fab fa-facebook-messenger" > < / i >

Abc Binary Code Code Example

Example: alphabet binary code Alphabet table Letter ASCII Code Binary Letter ASCII Code Binary a 097 0110 0001 A 065 0100 0001 b 098 0110 0010 B 066 0100 0010 c 099 0110 0011 C 067 0100 0011 d 100 0110 0100 D 068 0100 0100 e 101 0110 0101 E 069 0100 0101 f 102 0110 0110 F 070 0100 0110 g 103 0110 0111 G 071 0100 0111 h 104 0110 1000 H 072 0100 1000 i 105 0110 1001 I 073 0100 1001 j 106 0110 1010 J 074 0100 1010 k 107 0110 1011 K 075 0100 1011 l 108 0110 1100 L 076 0100 1100 m 109 0110 1101 M 077 0100 1101 n 110 0110 1110 N 078 0100 1110 o 111 0110 1111 O 079 0100 1111 p 112 0111 0000 P 080 0101 0000 q 113 0111 0001 Q 081 0101 0001 r 114

Android Glide Library Github Code Example

Example: android glide dependency dependencies { implementation 'com.github.bumptech.glide:glide:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' }

Android VectorDrawables.useSupportLibrary = True Is Stopping App

Answer : You cannot use Vector Drawables in any other views except ImageView in pre-lollipop. Please see this SO Answer by google developer advocate. For AppCompat users, we’ve decided to remove the functionality which let you use vector drawables from resources on pre-Lollipop devices due to issues found in the implementation in version 23.2.0/23.2.1 [ https://code.google.com/p/android/issues/detail?id=205236, https://code.google.com/p/android/issues/detail?id=204708 ]. Using app:srcCompat and setImageResource() continues to work. If you want to use the Vector Drawables pre-lollipop, use can set it programatically by converting it into a drawable. Drawable drawable; if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { drawable = context.getResources().getDrawable(drawableResId, context.getTheme()); } else { drawable = VectorDrawableCompat.create(context.getResources(), drawableResId, context.getTheme()); } button.setCompoundDrawablesWithIn

Add Circle Ci Status Badge Code Example

Example: add circle ci status badge template # Template: [![ < ORG_NAME > ](https://circleci.com/ < VCS > / < ORG_NAME > / < PROJECT_NAME > .svg?style=svg)]( < LINK > ) # Example: [![CircleCI](https://circleci.com/gh/circleci/circleci-docs.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs) # Example for specific branch: [![CircleCI](https://circleci.com/gh/circleci/circleci-docs/tree/teesloane-patch-5.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs/?branch=teesloane-patch-5)

Change Default Branch In Gitlab

Image
Answer : In 8.0+ it looks like this was moved into the project. If you open your project and go to the gear icon on the right, then "Edit Project" you can set the default branch for the project. To change default branch in GitLab: 1. Settings > General > General project settings > Expand 2. Default Branch > Change your project default branch 3. Save changes in the GitLab Enterprise Edition 12.2.0-pre you have to use following: Setting → Repository → Default Branch ( expand it) and change the default branch Here

Check If Variable Is Int Php Code Example

Example: php check if string is integer <?php $strings = array ( '1820.20' , '10002' , 'wsl!12' ) ; foreach ( $strings as $testcase ) { if ( ctype_digit ( $testcase ) ) { echo "The string $testcase consists of all digits.\n" ; } else { echo "The string $testcase does not consist of all digits.\n" ; } } ?>

8 Factorial Calculator Code Example

Example: calculate factorial int factorial ( int n ) { int res = 1 , i ; for ( i = 2 ; i <= n ; i ++ ) res *= i ; return res ; }

Codeigniter 3 Csrf Ajax Code Example

Example 1: codeigniter csrf token ajax $csrfName = $this->security->get_csrf_token_name(); $csrfHash = $this->security->get_csrf_hash(); Example 2: csrf in codeigniter 3 <! doctype html > < html > < head > < title > How to Send AJAX request with CSRF token in CodeIgniter </ title > </ head > < body > <!-- CSRF token (Here, name is 'csrf_hash_name' which is specified in $config['csrf_token_name'] in cofig.php file ) --> < input type = " text " class = " txt_csrfname " name = " <?= $this->security->get_csrf_token_name(); ?> " value = " <?= $this->security->get_csrf_hash(); ?> " > < br > Select Username : < select id = ' sel_user ' > < option value = ' yssyogesh ' > yssyogesh </ option > < option value = ' sonarika ' > sonarika </ o

11:59 Pm PST In Kuwait Time Code Example

Example: 9 pst to south africa time add 10 hours

Can You Use Scrapy And Selenium Together Code Example

Example: scrapy selenium screnshot #coding=utf-8 import time from selenium import webdriver from selenium . webdriver . chrome . options import Options def test_fullpage_screenshot ( self ) : chrome_options = Options ( ) chrome_options . add_argument ( '--headless' ) chrome_options . add_argument ( '--start-maximized' ) driver = webdriver . Chrome ( chrome_options = chrome_options ) driver . get ( "yoururlxxx" ) time . sleep ( 2 ) #the element with longest height on page ele = driver . find_element ( "xpath" , '//div[@class="react-grid-layout layout"]' ) total_height = ele . size [ "height" ] + 1000 driver . set_window_size ( 1920 , total_height ) #the trick time . sleep ( 2 ) driver . save_screenshot ( "screenshot1.png" ) driver . quit ( ) if __name__ == "__main__" : test_fullpage_screenshot ( )

Check Package Version In Python Code Example

Example: check package version python import packagename print ( packagename . __version__ )

Check If .php File Exists Code Example

Example 1: php file exist <?php $filename = '/path/to/foo.txt' ; if ( file_exists ( $filename ) ) { echo "The file $filename exists" ; } else { echo "The file $filename does not exist" ; } ?> Example 2: php check if file exists if ( ! file_exists ( 'http://mysite.com/images/thumbnail_1286954822.jpg' ) ) { $filefound = '0' ; }

Better Way To Revert To A Previous SVN Revision Of A File?

Answer : svn merge -r 854:853 l3toks.dtx or svn merge -c -854 l3toks.dtx The two commands are equivalent. Check out "undoing changes" section of the svn book sorry to use up some space on just a reiteration of the previously given answer - but this is something I always end up in trouble with. Let's say I've updated the local files to the latest revision, which is 854. Then, I'd want to get an older revision - the version of the file from few revision earlier, say revision 851. Copy would work: svn copy -r 851 svn+ssh://<repository URL>/l3toks.dtx ./l3toks.dtx .. however, I can't be bothered grepping for the repo URL :) Update seemingly might work: svn up -r 851 ./l3toks.dtx ... however, it also marks the local copy as "freshly checked out", or rather "same as online revision" (i.e. in Tortoise/RabbitVCS you get a green OK checkmark) - which means you cannot do svn ci -m "rolled back to r 851" : simp

Change Color Of Font Awesome Icon Code Example

Example 1: css change font awesome icon color Edit profile Example 2: css change font awesome icon color .fa { color: red !important; } Example 3: css change font awesome icon color . { color: red !important; } Example 4: how to change color of font awesome icons Edit profile

-23f To C Code Example

Example: convert fahrenheit to celsius import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int far = sc . nextInt ( ) ; int cel = ( far - 32 ) * 5 / 9 ; System . out . printf ( "%d Fahrenheit is %d Celsius" , far , cel ) ; } }