Posts

Showing posts from June, 2001

How Long Ago Is 1993 Code Example

Example 1: how long ago was 1993 years please { letme : stop ; } Example 2: how long since 1993 why { amI : writingthis ; }

Convert Ascii To Decimal Python Code Example

Example: ascii to decimal python >> > ord ( 'a' ) 97 >> > chr ( 98 ) 'b'

Can You Control GIF Animation With Javascript?

Answer : You can use the libgif library. It allows you to start/stop the gif and control which frame the gif is on. <script type="text/javascript" src="./libgif.js"></script> <img src="./example1_preview.gif" rel:animated_src="./example1.gif" width="360" height="360" rel:auto_play="1" rel:rubbable="1" /> <script type="text/javascript"> $$('img').each(function (img_tag) { if (/.*\.gif/.test(img_tag.src)) { var rub = new SuperGif({ gif: img_tag } ); rub.load(function(){ console.log('oh hey, now the gif is loaded'); }); } }); </script> (most of the code is taken directly from their example) I use x-gif it's pretty cool and easy to setup. From Github: <x-gif src="probably_cats.gif"></x-gif> Where you can add the following as attributes

How To Make Uppercase In Html Code Example

Example 1: css all caps .uppercase { text-transform : uppercase ; } #example { text-transform : none ; /* No capitalization, the text renders as it is (default) */ text-transform : capitalize ; /* Transforms the first character of each word to uppercase */ text-transform : uppercase ; /* Transforms all characters to uppercase */ text-transform : lowercase ; /* Transforms all characters to lowercase */ text-transform : initial ; /* Sets this property to its default value */ text-transform : inherit ; /* Inherits this property from its parent element */ } Example 2: html uppercase <p style= "text-transform: uppercase;" > All letters of all words will be in uppercase </p> Example 3: how to make text uppercase html text-transform : capitalize ;

Css Text 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: text color as gradient 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 ; } Example 3: css gradient generator /* 5 Best CSS Gradient Generator Links */ https : //cssgradient.io/ https : //www.colorzilla.com/gradient-editor/ https : //www.css-gradient.com/ https : //mycolor.space/gradient https : //uigradients.com/#Orca Example 4: color gradient generator /* "element" bieng the target class item to style */ .element { background : rgb ( 2 , 0 , 36 ) !important ; background : linear-gradient

Composer Require Ext-zip Fails

Answer : Solution #1 - add ext-zip to your required section of composer.json: { "require" : { "ext-zip": "*" } } Solution #2 - install php-zip extension: Windows: Uncomment this line in your php.ini ;extension=php_zip.dll Linux: sudo apt-get install php-zip or sudo apt-get install php7.0-zip (make sure you typed YOUR php version, you can check your version by doing php -v command) Then, you need to restart your web server. sudo service apache2 restart If your code runs OK - you've already got the zip extension installed on your machine. PHPStorm adds this suggestion to ensure that anywhere else that the project is deployed also has the right extensions too. Manually adding the line in your composer.json file ( require block) "ext-zip": "*", (and others that it can suggest, such as ext-apc , ext-redis and ext-json , as well as any others that you might be using) will make sure that when you deploy it c

Line Css Horizontal Code Example

Example 1: html horizontal line style <!-- HTML --> <!-- You can change the style of the horizontal line like this : --> <hr style= "width:50%" , size= "3" , color= black > <!-- Or like this : --> <hr style= "height:2px; width:50%; border-width:0; color:red; background-color:red" > Example 2: how to style an hr tag /* Red border */ hr .new1 { border-top : 1 px solid red ; } /* Dashed red border */ hr .new2 { border-top : 1 px dashed red ; } /* Dotted red border */ hr .new3 { border-top : 1 px dotted red ; } /* Thick red border */ hr .new4 { border : 1 px solid red ; } /* Large rounded green border */ hr .new5 { border : 10 px solid green ; border-radius : 5 px ; } Example 3: horizontal line Incase you are trying to diffrentiate between verical and horizontal. this is a horizontal line ------------ <! --Then Vertical goes straight from top to bottom. --> <! --to add a horizontal li

A 3D "ell" Shape Or "L" Shape

Image
Answer : To give you a start. \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{perspective} \begin{document} \begin{tikzpicture}[3d view={30}{15},line cap=round, declare function={ax=2;ay=1.5;az=2.5;bx=0.5;bz=0.5;}] \draw (0,0,0) -- (ax,0,0) -- (ax,0,bz) -- (bx,0,bz) -- (bx,0,az) -- (0,0,az) -- cycle (0,0,az) -- (0,ay,az) -- (bx,ay,az) edge ++ (0,-ay,0) -- (bx,ay,az) edge ++ (0,-ay,0) -- (bx,ay,bz) edge ++ (0,-ay,0) -- (ax,ay,bz) edge ++ (0,-ay,0) -- (ax,ay,0) -- (ax,0,0); \end{tikzpicture} \end{document} The perspective library allows us to change the view angles, and declare function is used to define parameters that can be changed, too. \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{perspective} \begin{document} \begin{tikzpicture}[3d view={40}{35},line cap=round, declare function={ax=3;ay=2;az=2.5;bx=0.8;bz=0.8;}] \draw (0,0,0) -- (ax,0,0) -- (ax,0,bz) -- (bx,0,bz) -- (bx,0,az) -- (0,0,az) -- cycle (0,0,az) -- (0,a

Can I Make An Enchantment Table Which Can Enchant To Higher Levels Then 30?

Answer : Sadly, it's impossible to enchant to higher levels than 30 on an enchantment table. In fact, it's only possible to get items enchanted with higher levels in the End Cities. I think this is not possible in minecraft any more, the only way would be, that you check if the player entchants something and put a higher entchantment level on it and take levels from him. But you would have to check for each item type and each entchandment combination. No, sadly you can't. There are mods that allow you to make a special enchantment table with special and unique enchantments, but back in the days in the beta of Minecraft you could enchant with way more levels and you can use the /echant command.

All MUI Icons Code Example

Example 1: @material-ui/icons yarn add @material-ui/icons # NPM npm install @material-ui/icons Example 2: react mui icons npm install @material-ui/core npm install @material-ui/icons import RoomIcon from '@material-ui/icons/Room'; < RoomIcon />

Bootstrap Shown.bs.tab Event Not Working

Answer : Bootstrap tab events are based off the .nav-tabs elements, not the .tab-content elements. So in order to tap into the show event, you need the element with an href that is pointed towards #tab1 , not the #tab1 content element itself. So instead of this: $('#tab1').on('shown.bs.tab', function (e) { console.log("tab1"); }); Do this instead: $('[href=#tab1]').on('shown.bs.tab', function (e) { console.log("tab1"); }); Or, to capture all of them, just do this: $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { console.log(e.target.href); }) Demo in Stack Snippets $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { console.log(e.target.href); }) <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet"/> <script src="//cdnjs.cloudflare.com/ajax/li

Servicenow Hi Code Example

Example: hi servicenow HI ( Service Now ) abbreviate Hosted Instance .

Copy Folder To Docker Container Code Example

Example 1: dockerfile copy folder to container ADD folder /path/inside/your/container Example 2: copy file to docker container docker cp foo.txt mycontainer:/foo.txt Example 3: docker copy folder to container docker cp Desktop/imagesets :tf_files/flower_photos/imagesets

Android Studio Login Template Code Example

Example: android studio login page template EditText username = (EditText)findViewById(R.id.editText1); EditText password = (EditText)findViewById(R.id.editText2); public void login(View view){ if(username.getText().toString().equals("admin") && password.getText().toString().equals("admin")){ //correcct password }else{ //wrong password }

Android Webview Set Proxy Programmatically Kitkat

Answer : Here is my solution: public static void setKitKatWebViewProxy(Context appContext, String host, int port) { System.setProperty("http.proxyHost", host); System.setProperty("http.proxyPort", port + ""); System.setProperty("https.proxyHost", host); System.setProperty("https.proxyPort", port + ""); try { Class applictionCls = Class.forName("android.app.Application"); Field loadedApkField = applictionCls.getDeclaredField("mLoadedApk"); loadedApkField.setAccessible(true); Object loadedApk = loadedApkField.get(appContext); Class loadedApkCls = Class.forName("android.app.LoadedApk"); Field receiversField = loadedApkCls.getDeclaredField("mReceivers"); receiversField.setAccessible(true); ArrayMap receivers = (ArrayMap) receiversField.get(loadedApk); for (Object receiverMap : receivers.values())

Add Primary Key To Existing Table Oracle Code Example

Example 1: add primary key constraint in oracle -- Adding Using alter ALTER TABLE table_name ADD CONSTRAINT constraint_name PRIMARY KEY ( column1 , column2 , . . . column_n ) ; Example 2: drop primary key oracle -- Dropping Using alter ALTER TABLE table_name DROP CONSTRAINT constraint_name ;

Bootstrap Pull-right Not Working As Expected

Answer : For those who are using bootstrap4: classes for responsive floats and removed .pull-left and .pull-right since they’re redundant to .float-left and .float-right. More information from Bootstrap4 migration notes: Here Your form-group is aligned as far to the right as possible – but the content within it is not. You have only 4+4+2 wide columns in there, so you are “two columns short”, in the 12-column grid used by bootstrap. You might want to simply offset the first one of those by 2, by adding col-xs-offset-2 class – then the alignment should be closer to what you want to achieve. Bootstrap column layout will basically split the row into 12 columns. Here you are only defining 10 out of the twelve columns, which is why you have space left on the right. Try <div class="form-group pull-right"> <div class="col-xs-4 col-xs-offset-2"> <input type="text" class="form-contro

Html Padding W3schools Code Example

Example 1: css padding padding : 5 px 10 px 15 px 20 px ; //top right bottom left padding : 10 px 20 px ; //top & bottom then left & right padding-top : 5 px ; //just top padding padding-right : 10 px ; //just right padding padding-bottom : 15 px ; //just bottom padding padding-left : 20 px ; //just left padding Example 2: padding css .box { padding : <padding-top> || <padding-right> || <padding-bottom> || <padding-left> }