Posts

Showing posts from March, 2009

Button Border Shadow Bootstrap Code Example

Example: give boodstarp card shadow <div class= "shadow-none p-3 mb-5 bg-light rounded" >No shadow</div> <div class= "shadow-sm p-3 mb-5 bg-white rounded" >Small shadow</div> <div class= "shadow p-3 mb-5 bg-white rounded" >Regular shadow</div> <div class= "shadow-lg p-3 mb-5 bg-white rounded" >Larger shadow</div>

Show Hide Div Javascript Code Example

Example 1: javascript hide div // javascript <script> document. getElementById ( "id" ) .style.display = "none" ; //hide document. getElementById ( "id" ) .style.display = "block" ; //show document. getElementById ( "id" ) .style.display = "" ; //show </script> // html <html> <div id= "id" style= "display:none" > <div id= "id" style= "display:block" > </html> // jquery <script> $ ( "#id" ) . hide ( ) ; $ ( "#id" ) . show ( ) ; </script> Example 2: how to show hide div in html javascript <!DOCTYPE html > <html > <head > <meta name="viewport" content="width=device-width , initial-scale=1" > <style > #myDIV { width : 100 % ; padding : 50 px 0 ; text-align : center ; background-color : lightblue ; margin-top : 20 px ; } </styl

Horizontal Space Latex Code Example

Example 1: give space in latex Horizontal \hspace { 1 cm } spaces can be inserted manually . Useful to control the fine - tuning in the layout of pictures . Left Side \hfill Right Side Example 2: spacing lines latex \usepackage { setspace } \doublespacing

Cookie Clicker Source Code Code Example

Example 1: cookie clicker #Hacks: # Type these in your console which you can open by # pressing STRG + SHIFT + J (Chrome) or STRG + SHIFT + K (Firefox) # changes the amount of cookies Game.cookies = amount in int # unlimted cookies Game.cookies = Infinity # If you want to get out of Infinity cookies Game.cookiesd = 0 # set up the CookiesPerSecond Rate by the number you want Game.cookiesPS= amount in int # clicks on cookie forever without moving your mouse in the highest speed var autoclicker = setInterval(function() { Game.ClickCookie(); }, 10); # stoping autoclicker clearInterval(autoClicker) # clicks on golden cookie without moving your mouse setInterval(Game.goldenCookie.click, 500) # Get the achievement you want by changing it to the achievement name you want # Game.Win(‚ACHIEVEMENT‘) Example 2: cookie clicker haha dopamine go brrrrrrrr Example 3: cookie clicker legendary og game Example 4: cookie clicke

Google Fonts 'Montserrat',sans-serif Code Example

Example: montserrat font google fonts <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" >

Accessing The Web Page's HTTP Headers In JavaScript

Answer : It's not possible to read the current headers. You could make another request to the same URL and read its headers, but there is no guarantee that the headers are exactly equal to the current. Use the following JavaScript code to get all the HTTP headers by performing a get request: var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getAllResponseHeaders().toLowerCase(); alert(headers); Unfortunately, there isn't an API to give you the HTTP response headers for your initial page request. That was the original question posted here. It has been repeatedly asked, too, because some people would like to get the actual response headers of the original page request without issuing another one. For AJAX Requests: If an HTTP request is made over AJAX, it is possible to get the response headers with the getAllResponseHeaders() method. It's part of the XMLHttpRequest API. To see how this can be ap

Font Montserrat Bold 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" >

Anchor Jumping By Using Javascript

Answer : You can get the coordinate of the target element and set the scroll position to it. But this is so complicated. Here is a lazier way to do that: function jump(h){ var url = location.href; //Save down the URL without hash. location.href = "#"+h; //Go to the target element. history.replaceState(null,null,url); //Don't like hashes. Changing it back. } This uses replaceState to manipulate the url. If you also want support for IE, then you will have to do it the complicated way: function jump(h){ var top = document.getElementById(h).offsetTop; //Getting Y of target element window.scrollTo(0, top); //Go there directly or some transition }​ Demo: http://jsfiddle.net/DerekL/rEpPA/ Another one w/ transition: http://jsfiddle.net/DerekL/x3edvp4t/ You can also use .scrollIntoView : document.getElementById(h).scrollIntoView(); //Even IE6 supports this (Well I lied. It's not

Add Ssh-key To Github Actions Code Example

Example: github actions set ssh key https://github.com/webfactory/ssh-agent

Connecting To IMDB

Answer : The libraries for IMDb seem quite unreliable at present and highly inefficient. I really wish IMDb would just create a webservice. After a bit of searching I found a reasonable alternative to IMDb. It provides all the basic information such as overview, year, ratings, posters, trailers etc.: The Movie Database (TMDb). It provides a webservice with wrappers for several languages and seems reliable so far. The search results have been, for myself, more accurate as well. There is no webservice available. But there are enough html scrapers written in every language to suit your needs! I've used the .NET 3.5 Imdb Services opensource project in a few personal projects. 1 minute google results: Perl: IMDB-Film Ruby: libimdb-ruby Python: IMDbPY The only "API" the IMDb publishes is a set of plain-text data files containing formatted lists of actors, directors, movies, etc. You would likely need to write your own parser unless somebody has released one for your language

Git Remote Update Code Example

Example 1: git update remote origin git remote set - url origin new . git . url / here Example 2: git update remote origin git remote set - url origin new . git . url / here git remote add origin new . git . url / here

Can You Resolve An Angularjs Promise Before You Return It?

Answer : Short answer: Yes, you can resolve an AngularJS promise before you return it, and it will behave as you'd expect. From JB Nizet's Plunkr but refactored to work within the context of what was originally asked (i.e. a function call to service) and actually on site. Inside the service... function getSomething(id) { // There will always be a promise so always declare it. var deferred = $q.defer(); if (Cache[id]) { // Resolve the deferred $q object before returning the promise deferred.resolve(Cache[id]); return deferred.promise; } // else- not in cache $http.get('/someUrl', {id:id}).success(function(data){ // Store your data or what ever.... // Then resolve deferred.resolve(data); }).error(function(data, status, headers, config) { deferred.reject("Error: request returned status " + status); }); return deferred.promise; } Inside the

Connecting To FTPS (FTP Over SSL) With FluentFTP

Answer : As you seem to be connecting to the default port 21 (no explicit port specified anywhere), you need to use the "Explicit" mode: conn.EncryptionMode = FtpEncryptionMode.Explicit;

Bootstrap Text Bold Code Example

Example 1: text-bold bootstrap < p class = " font-weight-bold " > Bold text. </ p > Example 2: font weight bootstrap class < p class = " font-weight-bold " > Bold text. </ p > < p class = " font-weight-normal " > Normal weight text. </ p > < p class = " font-weight-light " > Light weight text. </ p > < p class = " font-italic " > Italic text. </ p > Example 3: bootstrap italic < p class = " font-italic " > Italic text. </ p > Example 4: bootstrap 4 font bold font-weight-bold Example 5: bootstrap alignemnt paragraph < p class = " text-justify " > Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. Praeterea iter est quasdam res quas ex communi. At nos hinc posthac, sitientis piros Afros. Petierunt uti sibi concilium totius Galliae i

Addclass And Remove Class Javascript Code Example

Example 1: javascript remoev css class //remove a css class from an element document . getElementById ( "myElementID" ) . classList . remove ( "class_name" ) ; Example 2: javascript add class to element var someElement = document . getElementById ( "myElement" ) ; someElement . className += " newclass" ; //add "newclass" to element (space in front is important) Example 3: how to remove an class in javascript document . getElementsByClassName ( "legend" ) . style . display = "none" ;

15000 Euro To Inr Code Example

Example: 15000 usd to bdt 1 usd = approx 80 bdt

Raspberry Pi Default Password Not Working Code Example

Example: default password raspberry pi User management in Raspberry Pi OS is done on the command line . The default user is pi , and the password is raspberry .

Correct Way To Add External Jars (lib/*.jar) To An IntelliJ IDEA Project

Image
Answer : Steps for adding external jars in IntelliJ IDEA : Click File from the toolbar Select Project Structure option ( CTRL + SHIFT + ALT + S on Windows/Linux, ⌘ + ; on Mac OS X) Select Modules at the left panel Select Dependencies tab Select + icon Select 1 JARs or directories option IntelliJ IDEA 15 & 2016 File > Project Structure... or press Ctrl + Alt + Shift + S Project Settings > Modules > Dependencies > " + " sign > JARs or directories... Select the jar file and click on OK, then click on another OK button to confirm You can view the jar file in the "External Libraries" folder Just copy-paste the .jar under the "libs" folder (or whole "libs" folder), right click on it and select 'Add as library' option from the list. It will do the rest...

Caching A Jquery Ajax Response In Javascript/browser

Answer : cache:true only works with GET and HEAD request. You could roll your own solution as you said with something along these lines : var localCache = { data: {}, remove: function (url) { delete localCache.data[url]; }, exist: function (url) { return localCache.data.hasOwnProperty(url) && localCache.data[url] !== null; }, get: function (url) { console.log('Getting in cache for url' + url); return localCache.data[url]; }, set: function (url, cachedData, callback) { localCache.remove(url); localCache.data[url] = cachedData; if ($.isFunction(callback)) callback(cachedData); } }; $(function () { var url = '/echo/jsonp/'; $('#ajaxButton').click(function (e) { $.ajax({ url: url, data: { test: 'value' }, cache: true, beforeSend: function () { i

Android Studio 32 Bit Code Example

Example: install android studio java --version sudo apt install openjdk-11-jdk sudo add-apt-repository ppa:maarten-fonville/android-studio sudo apt update sudo apt install android-studio