Posts

Showing posts from August, 2021

Responsive Background Image In Html Css Code Example

Example 1: make a background image responsive css html { min-height : 100 % ; background-image : url ( image.jpg ) ; background-size : cover ; background-repeat : no-repeat ; background-position : center center ; } Example 2: background image size css #example1 { background : url ( mountain.jpg ) ; background-repeat : no-repeat ; background-size : auto ; } #example2 { background : url ( mountain.jpg ) ; background-repeat : no-repeat ; background-size : 300 px 100 px ; }

Delay Function In C Not Working Code Example

Example: C delay /** really not much to say... just a way to program a delay between commands in your code. **/ //C library statement # include <time.h> //Driver program void dealy ( int numOfSec ) { /* the delay itself runs with milli seconds so here we multiply the seconds by 1000. */ int numOfMilliSec = 1000 * numOfSec ; /* Making the time pass with nothing running until the time is up. */ time_t startTime = clock ( ) ; while ( clock ( ) < startTime + numOfMilliSec ) ; } /*To use the delay just use the command: delay(x); you need to replace x with the number of seconds that you want the delay to be. */ ///The code itself without the details: # include <time.h> void delay ( int numOfSec ) { int numOfMilliSec = 1000 * numOfSec ; time_t startTime = clock ( ) ; while ( clock ( ) < startTime + numOfMilliSec ) ; }

Put Icon In Content Before Css Code Example

Example 1: how to insert icons pseudo content .css :after { content : "\86" ; color : red ; } .css .char :after { content : "†" ; color : blue ; } .data :after { content : attr ( data-icon ) ; } .js :after { content : attr ( data-icon ) ; } .red :after { color : red ; } .blue :after { color : blue ; } Example 2: how to insert icons pseudo content <div class= "css" >hard coded css content</div> <div class= "css char" >hard coded css content char</div> <br> <div class= "data red" data-icon= "†" >hard coded data-icon</div> <div class= "data blue" data-icon= "†" >hard coded data-icon char</div> <br> <div class= "js red" >data-icon by js</div> <div class= "js blue" >data-icon by js char</div>

Cookie Clicker Hack Code Code Example

Example 1: cookie clicker hack // change number of cookies (you can still click on things that look unselectable) Game.cookies = 100000000 // and auto clicker: function myFunction() {document.getElementById("bigCookie").click();document.getElementById("bigCookie").click();document.getElementById("bigCookie").click()}; window.setInterval(myFunction, 0.0001) Example 2: cookie clicker hack extension // change number of cookies (you can still click on things that look unselectable) Game.cookies = 100000000 // and auto clicker: function myFunction() {document.getElementById("bigCookie").click();document.getElementById("bigCookie").click();document.getElementById("bigCookie").click()}; window.setInterval(myFunction, 0.0001

Fgets Stdin In C Code Example

Example: fgets function in c char str [ 20 ] ; //declare string of 20 fgets ( str , 20 , stdin ) ; // read from stdin puts ( str ) ; // print read content out to stdout

Html Font Tag Image Code Example

Example 1: make text blue html <p style= "color:blue;" >This paragraph is blue .</p> Example 2: font tag html Not Supported in HTML 5 | Support till HTML 4 <font color= "red" face= "Verdana, Geneva, sans-serif" size= "+1" > Your formatted text goes here </font>

Hasclass Js Code Example

Example 1: jquery hasclass if ( $ ( " #foo " ) .hasClass ( 'className' ) ) { $ ( "#foo" ) . removeClass ( 'className' ) ; } else { $ ( "#foo" ) . addClass ( 'className' ) ; } Example 2: javascript hasclass if ( document .body .classList .contains ( 'thatClass' ) ) { // do some stuff } Example 3: javascript hass class if ( myElement .classList .contains ( 'someClassname' ) ) { // do something } Example 4: query selector has clas document.body.classList. add ( 'thisClass' ) ; // $ ( 'body' ) . addClass ( 'thisClass' ) ; document.body.classList. remove ( 'thatClass' ) ; // $ ( 'body' ) . removeClass ( 'thatClass' ) ; document.body.classList. toggle ( 'anotherClass' ) ; // $ ( 'body' ) . toggleClass ( 'anotherClass' ) ; Example 5: how to check has class name in js? element.classList. contains ( className ) ; Code language :

Can I Make It Always Night Time?

Answer : As of 0.16.0, you can change the time to night one time by /time set night To make it night constantly, (or if you are on lower versions then 0.16) you can use a mod: Simple Commands mod Simple Commands mod adds a few new, simple text commands. Now, among the "standard" commands will have a new command that has the effect to your character. In total there are 23 different effects, such as speed and invisibility - it is the effects of potions. With these commands, you can affect the gamegame mode, weather, time, deceleration time, set the level of experience, and more in MCPE 0.11-0.15.7 pocketInvEditor mod (available on Google Play) PocketInvEditor is an inventory editor for Minecraft Pocket Edition. With this tool, you can give yourself more blocks and items without writing a single hexadecimal digit or connecting to a computer. the mod also allows locking the day/night cycle It seems that as of the 1.1 update "The Discovery Update&

Arduino Switch Case In Switch Case Code Example

Example 1: swich case arduino // Arduino => c++ switch ( var ) { case 1 : //do something when var equals 1 break ; case 2 : //do something when var equals 2 break ; default : // if nothing else matches, do the default // default is optional break ; } Example 2: arduino switch case switch ( var ) { case label1 : // statements break ; case label2 : // statements break ; default : // statements break ; }

Bootstrap Toast Does Not Show Up

Answer : You need to put the valid option. i:e show, hide or a callback function . See - https://getbootstrap.com/docs/4.2/components/toasts/. $('.toast').toast('show'); <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <div class="toast" role="alert" aria-live="assertive" aria-atomic="true"> <div class="toast-header"> <img height="200px" width="200px" src="https://upload.wikimedia.org/wikipedia/commons/f/f9/Phoenicopterus_ruber_in_S%C3%A3o_Paulo_Zoo.jpg" class="rounded mr-2" alt="..."> <strong class="mr-auto">Boots

20 Mins Timer Code Example

Example: 20 minute timer for good eyesight every 20 minutes look out the window at something 20 feet away for 20 seconds

Can't Mount NTFS Drive - "NTFS Signature Is Missing."

Answer : You are trying to mount whole Hard Disk drive instead of Partition on it. Try mounting /dev/sdc1 instead of /dev/sdc .

4ft To Inches Code Example

Example: foot to inch 1 foot = 12 inches

13,8cm To Inches Code Example

Example: cm to inch 1 cm = 0.3937 inch

Bypassing Bell Canada's Router Provided With Their FIBE Service

Answer : Not sure if the question is still relevant, but still wanted to share the result of my investigation.. I just switched from a Cable ISP to Bell Fibe, for both TV and Internet. Bell still don't have Fibre to home in my area, so is is still somewhat a DSL type connection. Bell provided a HUB2000 integrated modem/router. the device is very user friendly, but all advanced network features are blocked.... as expected. I had my entire network already set up as with my previous internet provider (Videotron only provided a cable modem) and i wanted to maintain the same configuration (firewall, IPs, etc).. So this is what I have done: TV receiver is connected via a network cable to the HUB2000 LAN port (as per the original Bell set up) HUB 2000 is connected to the phone line to act as a DSL modem (as per the original set up) WAN port of my MikroTik router is connected to one of the LAN ports of the HUB 2000. Now here is the trick, in my Mikrotik WAN configuration, in

Css Scrollbar-width Example

The scrollbar-width property allows the author to set the maximum thickness of an element’s scrollbars when they are shown. Initial value auto Applies to scrolling boxes Inherited no Computed value as specified Animation type discrete Syntax /* Keyword values */ scrollbar-width : auto ; scrollbar-width : thin ; scrollbar-width : none ; /* Global values */ scrollbar-width : inherit ; scrollbar-width : initial ; scrollbar-width : unset ; Values <scrollbar-width> Defines the width of the scrollbar as a keyword. It must be one of the following values: auto The default scrollbar width for the platform. thin A thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width. none No scrollbar shown, however the element will still be scrollable. Note : User Agents must apply any scrollbar-width value set on the root element to the viewport. Accessibility concerns Use this property with

Convertir Youtube A Mp3 Code Example

Example: 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/

Can't Clone Private Repo On Github From SourceTree

Image
Answer : It happens because SourceTree didn't get some private access from Github while authenticating. So the solution is very simple Login into your Github account on any browser From top right corner select SETTINGS Now select DEVELOPER SETTINGS From DEVELOPER SETTINGS select PERSONAL ACCESS TOKEN Now from PERSONAL ACCESS TOKEN select GENERATE TOKEN Fill Note as sourcetree and Check All Scopes from checkbox as show in below screenshots After Click on Generate Token Now Open sourceTree Click on sourceTree preference & Click add Account Select options as shown in below screen shot Enter username as your Github account username and password as Generated Token from Github Click on SAVE now you might see all your repository are visible and can clone too Hope it helps I had same problem. My fix way: Remove user from SourceTree settings (optional, i not sure); Add you account in setting and generate new SSH key (it's a main part of fix);

Css Flex Center Horizontally Code Example

Example 1: css flex center horizontally and vertically display : flex ; align-items : center ; justify-content : center ; Example 2: centering with flexbox /* HORIZONTAL */ justify-content : center ; /* VERTICAL */ align-items : center ; Example 3: how center content in css by using flex display : flex ; width : 60 % ; justify-content : center ; margin : 0 auto ; Example 4: center div css flex section { width : 200 px ; border : 1 px solid #2d2d2d ; display : flex ; justify-content : center ; } Example 5: css center image horizontal and vertical flexbox <!doctype html > <html lang="en" > <head > <meta charset="utf-8" > <meta name="viewport" content="width=device-width , initial-scale=1 .0 " > <title > Center Flex Item Image</title > <style > .box { width : 80 % ; min-height : 80 vh ; margin : auto ; border : 1 px solid ; display : flex

C# Datetime Parseexact Code Example

Example: parse datetime c# using System . Globalization ; DateTime . ParseExact ( "20200101123000" , "yyyyMMddHHmmss" , CultureInfo . InvariantCulture )

Montserrat Extra Light Font 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 Or Extract TTC Font To TTF - How To?

Answer : Assuming that Windows doesn't really know how to deal with TTC files (which I honestly find strange), you can "split" the combined fonts in an easy way if you use fontforge. The steps are: Download the file. Unzip it (e.g., unzip "STHeiti Medium.ttc.zip" ). Load Fontforge. Open it with Fontforge (e.g., File > Open ). Fontforge will tell you that there are two fonts "packed" in this particular TTC file (at least as of 2014-01-29) and ask you to choose one. After the font is loaded (it may take a while, as this font is very large), you can ask Fontforge to generate the TTF file via the menu File > Generate Fonts... . Repeat the steps of loading 4--6 for the other font and you will have your TTFs readily usable for you. Note that I emphasized generating instead of saving above: saving the font will create a file in Fontforge's specific SFD format, which is probably useless to you, unless you want to develop fonts with Fontforge.

Android Canvas Clear With Transparency

Answer : Use the following. canvas.drawColor(Color.TRANSPARENT,Mode.CLEAR); The solution was to create a secondary canvas and bitmap to draw on. My Custom View's onSizeChanged() method looked like @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888); bitmap.eraseColor(Color.TRANSPARENT); temp = new Canvas(bitmap); } and the onDrawMethod looks like @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); temp.drawColor(Color.argb(80, 0, 0, 0)); temp.drawCircle(centerPosX, centerPosY, 200, transparentPaint); canvas.drawBitmap(bitmap, 0, 0, null); } where transparentPaint is declared in the onstructor as transparentPaint = new Paint(); transparentPaint.setColor(getResources().getColor(android.R.color.transparent)); transparentPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.

Access Host's Ssh Tunnel From Docker Container

Answer : Using your hosts network as network for your containers via --net=host or in docker-compose via network_mode: host is one option but this has the unwanted side effect that (a) you now expose the container ports in your host system and (b) that you cannot connect to those containers anymore that are not mapped to your host network. In your case, a quick and cleaner solution would be to make your ssh tunnel "available" to your docker containers (e.g. by binding ssh to the docker0 bridge) instead of exposing your docker containers in your host environment (as suggested in the accepted answer). Setting up the tunnel: For this to work, retrieve the ip your docker0 bridge is using via: ifconfig you will see something like this: docker0 Link encap:Ethernet HWaddr 03:41:4a:26:b7:31 inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0 Now you need to tell ssh to bind to this ip to listen for traffic directed towards port 9000 via ssh -L 1