Skip to main content

Posts

JS to show time slots ( PROGRESS TIMER )

  function format(time) {        // Hours, minutes and seconds     var hrs = ~~(time / 3600);     var mins = ~~((time % 3600) / 60);     var secs = ~~time % 60;     // Output like "1:01" or "4:03:59" or "123:03:59"     var ret = "";     if (hrs > 0) {         ret += "" + hrs + ":" + (mins < 10 ? "0" : "");     }     ret += "" + mins + ":" + (secs < 10 ? "0" : "");     ret += "" + secs;     return ret; } console.log(format(34322)); REF :  Labstack

Android emulator not able to access the internet

Change the DNS address of your network to 8.8.8.8 (Google's DNS) or another of your preference: MacOSX: Open "System Preferences" Click on "Network" Select the network which your computer is connected and click on "Advanced" Select "DNS", Select the "+" button, type "8.8.8.8" (Google's DNS) or if you prefer OpenDNS, "208.67.222.222" Select "Ok" and "Apply" Windows & Linux: https://developers.google.com/speed/public-dns/docs/using After that close the emulator and start it again. URL :  https://stackoverflow.com/questions/42736038/android-emulator-not-able-to-access-the-internet

REACT NATIVE DYNAMIC STAR RATING

  renderRatings ( rating ){     let stars = [];     // Loop 5 times     for (var i = 1; i <= 5; i++) {       // Set the path to filled stars       let path = <Icon name="star" style={{fontSize: 10, color: '#eb9534',marginHorizontal:2}}/>;       // If ratings is lower, set the path to unfilled stars       if (i > rating ) {         path = <Icon name="star" style={{fontSize: 10, color: theme.LIGHT_GREY_COLOR, marginHorizontal:2}}/>;       }       // Push the Image tag in the stars array       stars.push(path);     }     return (       <View style={{flexDirection:"row",marginTop: 5,}}>            { stars }       </View>     )   }     render () {   ...

REACT NATIVE FONT INTEGRATION

REFERENCE URL   Download required fonts https://www.1001freefonts.com/gobold.font  1. Create an assets folder at the root of your project directory  2. Create a fonts folder within the assets folder and place your font files here  3. In your package.json specify where the custom fonts are located   "rnpm": {       "assets": [ "./assets/fonts/" ]  }  4. Next run the command react-native link

SEARCH TABLE DATA JAVA SCRIPT

———————————————————————— CDN https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.js ———————————————————————— HTML  <input type="text" id="search" placeholder="Search"> ———————————————————————— JS (any column)  $("#search").on("keyup", function() {                 var value = $(this).val();                                  $("table tr").each(function(index) {                     if (index !== 0) {                         $row = $(this);                         var text = $row.text();                                          ...