Posts

Showing posts from February, 2004

Html Font Names Code Example

Example 1: css font family p { font-family : garamond , serif ; } Example 2: font-family css font-family : "Times New Roman" , Georgia , serif ; /* If the browser does not support the first font (ie: Times New Roman), it will then try the next font (ie: Georgia). The last font should always be a "generic-family" font (ie: serif, sans-serif, etc..). /* If font is more then one word, it must be put into quotes. */ Example 3: font family css font-family : "Comic Sans MS" , cursive , sans-serif ; Example 4: css font family /* You can set the font family by using font-family: followed by the font family name If you want to use a google font you have to find it on the google font website then link the script in your HTML and then put the name in font family browse fonts: https://fonts.google.com/ */ .class { font-family : sans-serif }

Creating A 16x16 Grid Using JavaScript

Answer : It would be much cleaner to use CSS variables and CSS grid to create dynamic rows and columns. const container = document.getElementById("container"); function makeRows(rows, cols) { container.style.setProperty('--grid-rows', rows); container.style.setProperty('--grid-cols', cols); for (c = 0; c < (rows * cols); c++) { let cell = document.createElement("div"); cell.innerText = (c + 1); container.appendChild(cell).className = "grid-item"; }; }; makeRows(16, 16); :root { --grid-cols: 1; --grid-rows: 1; } #container { display: grid; grid-gap: 1em; grid-template-rows: repeat(var(--grid-rows), 1fr); grid-template-columns: repeat(var(--grid-cols), 1fr); } .grid-item { padding: 1em; border: 1px solid #ddd; text-align: center; } <div id="container"> </div> Try let n=16, i=-1, j=0, s=''; while(++i<n) { s+= '<div class="row">' for(j=0;

Bootstrap Studio 4 Download Free Code Example

Example: bootstrap studio download You can download bootstrap studio by refering below link https://bootstrapstudio.io/download By following the link you just need to select your OS And then you can download you OS Compatible bootstrap studio.

Create Dictionary Of Dict In Python By User Input Code Example

Example 1: create dictionary from input python marks = {} for i in range(10): student_name = input("Enter student's name: ") student_mark = input("Enter student's mark: ") marks[student_name.title()] = student_mark print(marks) Example 2: user input dictionary python # Creates key, value for dict based on user input # Combine with loops to avoid manual repetition class_list = dict() data = input('Enter name & score separated by ":" ') temp = data.split(':') class_list[temp[0]] = int(temp[1]) OR key = input("Enter key") value = input("Enter value") class_list[key] = [value]

Can I Adjust The Aspect Ratio On A Nintendo Switch To Display On A 4:3 Monitor?

Answer : No , it doesn't seem so. It seems Nintendo imagined that people would only connect to 16:9 displays and did not add any options in the Switch display settings. I have been having the same trouble for months. I have my switch hooked up to a 4:3 CRT TV via HDMI to RCA converter. It may be possible to find an adapter that can translate the image to show at a proper aspect.

Remove Horizontal Scroll Bar Css Code Example

Example 1: DISABLE the Horizontal Scroll html , body { max-width : 100 % ; overflow-x : hidden ; } Example 2: hide horizontal scrollbar css .x-scroll-disabled { overflow-x : hidden ; } Example 3: remove horizontal scrollbar css overflow-x : hidden ; Example 4: how to remove horizontal scrolling /* this works for vertical scrolling also this is useful for those who can't use overflow: hidden or any other solution because the css on the website changes in someway */ ::-webkit-scrollbar :horizontal { display : none ; }

4x1 Mux Gate Level Code Example

Example: 4 to 1 5 bit mux module mux_4to1_assign ( input [3:0] a, // 4-bit input called a input [3:0] b, // 4-bit input called b input [3:0] c, // 4-bit input called c input [3:0] d, // 4-bit input called d input [1:0] sel, // input sel used to select between a,b,c,d output [3:0] out); // 4-bit output based on input sel // When sel[1] is 0, (sel[0]? b:a) is selected and when sel[1] is 1, (sel[0] ? d:c) is taken // When sel[0] is 0, a is sent to output, else b and when sel[0] is 0, c is sent to output, else d assign out = sel[1] ? (sel[0] ? d : c) : (sel[0] ? b : a); endmodule

Bootstrap Vue Table: Show Details When Row Clicked

Answer : Hard to find... but just add this: @row-clicked="item=>$set(item, '_showDetails', !item._showDetails)" Explanation The $set preserves the reactivity even if _showDetails didn't exist. It's a pitty that the row object is not accessible, so toggleDetails is not an option here. As mentioned on the row details support section of the Bootstrap Vue table documentation, you can change the _showDetails property of the row item: If the record has it's _showDetails property set to true, and a row-details scoped slot exists, a new row will be shown just below the item, with the rendered contents of the row-details scoped slot. In your case, you would want something like: expandAdditionalInfo(row) { row._showDetails = !row._showDetails; }, As demonstrated in this codepen

Android Get Sha1 Fingerprint Programmatically Code Example

Example: android developer sha1 fingerprint keytool -list -v \ -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore

Amc Stocktwits Code Example

Example 1: amc stock There once was a stock that put to sea The name of the stock was $AMC The price blew up , the shorts dipped down Hold my bully boys hold Soon may the tendieman come to send our rocket into the sun One day when the trading is done we'll take our gains and go She had not been two weeks from shore When Ryan Cohen joined the board The captain called all hands and swore He'll take his shares and hold Soon may the tendieman come to send our rocket into the sun One day when the trading is done we'll take our gains and go Before the news had hit the market Wall Street Bets came up and bought it with diamond hands they knew they'd profit if they could only hold Soon may the tendieman come to send our rocket into the sun One day when the trading is done we'll take our gains and go No deals were cut , no shorts were squeezed The captain's mind was not on greed But he belonged to the autist's creed He took the risk to h

How To Create A Fixed Left Menu Code Example

Example: how to fix the nav bar to the left of the page .sidenav { height : 100 % ; width : 160 px ; position : fixed ; z-index : 1 ; top : 0 ; left : 0 ; overflow-x : hidden ; }

100 F To C Code Example

Example 1: fahrenheit to celsius formula cels = ( fahr - 32.0 ) * 5.0 / 9.0 ; //Fahr to cels fahr = ( cels * 9.0 / 5.0 ) + 32.0 ; //Cels to fahr Example 2: 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 ) ; } } Example 3: c to f let f = c * ( 9 / 5 ) + 32 ; let c = ( f - 32 ) * ( 5 / 9 ) ; Example 4: 14 f to c 14 ° F = - 10 ° C

Can I Export A Variable To The Environment From A Bash Script Without Sourcing It?

Answer : Is there any way to access to the $VAR by just executing export.bash without sourcing it ? Quick answer: No. But there are several possible workarounds. The most obvious one, which you've already mentioned, is to use source or . to execute the script in the context of the calling shell: $ cat set-vars1.sh export FOO=BAR $ . set-vars1.sh $ echo $FOO BAR Another way is to have the script, rather than setting an environment variable, print commands that will set the environment variable: $ cat set-vars2.sh #!/bin/bash echo export FOO=BAR $ eval "$(./set-vars2.sh)" $ echo "$FOO" BAR A third approach is to have a script that sets your environment variable(s) internally and then invokes a specified command with that environment: $ cat set-vars3.sh #!/bin/bash export FOO=BAR exec "$@" $ ./set-vars3.sh printenv | grep FOO FOO=BAR This last approach can be quite useful, though it's inconvenient for interactive use sin

External Css File Html Code Example

Example 1: how to link css to html <link rel= "stylesheet" href= "styles.css" > Example 2: add css file to html /* Adding css file into html document */ <link rel= "stylesheet" type= "text/css" href= "yourstylesheetname.css" > /* add this line into head tag of the file with change in file name. */ /* I hope it will help you. Namaste */ Example 3: add stylesheet to html <!-- Linking External Style Sheets -- > <head > <link rel="stylesheet" href="css/style .css " / > </head > <!-- Embedded Style Sheets -- > <head > <style > body { background-color : YellowGreen ; } h1 { color : blue ; } p { color : red ; } </style> </head> <!-- Inline Styles --> <h1 style= "color: red; font-size: 30px" >This is a heading</h1> <p style= "color: green; f

Add Newline To Oh My ZSH Theme

Image
Answer : I was actually searching for the same answer. But my needs was a little more specific since I only wanted to add a newline in the agnoster theme, the one I'm using now. In my research, I find a lot of forked themes that already do it, but I thought that this was an overkill solution for only add a new line. So I read the agnoster code and come up with this simple solution of overwrite the prompt_end() function in my .zshrc file. To do it, just add the code bellow in your .zshrc file: prompt_end() { if [[ -n $CURRENT_BG ]]; then print -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" else print -n "%{%k%}" fi print -n "%{%f%}" CURRENT_BG='' #Adds the new line and ➜ as the start character. printf "\n ➜"; } Hope it helps you to have a clue on how to customize your chosen theme. Here is the result: I think the proper place to change one's prompt is in the theme itself. On my syst

Css Scrollbars On Div Code Example

Example 1: how to style scrollbar in div #style-1::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); border-radius: 10px; background-color: #F5F5F5; } #style-1::-webkit-scrollbar { width: 12px; background-color: #F5F5F5; } #style-1::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); background-color: #555; } Example 2: scrollbar css .any-class::-webkit-scrollbar { width: 8px; } .any-class::-webkit-scrollbar-track { background: #c1c0c0; } .any-class::-webkit-scrollbar-thumb { background: #828282; } .any-class::-webkit-scrollbar-thumb:hover { background: #555; } Example 3: css scrollbar in div The scrollbar can be triggered with any property overflow, overflow-x, or overflow-y and each can be set to any of visible, hidden, scroll, auto, or inherit. You are currently looking at these two: auto - This value will look at the width and height of the box. If they are defined, it won't let the box expan

C Max Integer Value Code Example

Example: max size for int c - 2 , 147 , 483 , 648 to 2 , 147 , 483 , 647

@media Only Screen And (min-width 768px) And (max-width 1024px) Code Example

Example 1: media query min and max /* Max-width */ @media only screen and ( max-width : 600 px ) { ... } /* Min-width */ @media only screen and ( min-width : 600 px ) { ... } /* Combining media query expressions */ @media only screen and ( max-width : 600 px ) and ( min-width : 400 px ) { ... } Example 2: media query min max @media screen and ( min-width : 200 px ) and ( max-width : 640 px ) { .bloc { display : block ; clear : both ; } } Example 3: @media screen and (min-width @media ( min-width : 1250 px ) { ... }