What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-22 17:06:09
how can I get response from amazon with beautiful soap if I get 503?
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0", "Accept-Encoding":"gzip, deflate", "Accept":"text/html,application/xhtml+xml,application/xml;q... Add solution -
Javascript 2021-11-21 16:55:18
javascript if browser out of focus
var hidden, visibilityChange; if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support hidden = "hidden"; visibilityChange = "visibilitychange"; } else if (typeof document.msHidden !==... Add solution -
Other 2021-11-21 00:10:17
graident colors
background: #659999; /* fallback for old browsers */ background: -webkit-linear-gradient(to right, #659999, #f4791f); /* Chrome 10-25, Safari 5.1-6 */ background: linear-gradient(to right, #659999, #f4791f); /* W3C, IE 10+/ Edge, Firefox 16+, Chrom... Add solution -
Other 2021-11-20 19:08:22
could not connect to websocket endpoint ws://localhost:4000/graphql. please check if the endpoint url is correct.
The it turns out that Firefox has issues with websockets (see this bug report that has been re-appeared even after the supposed fix). In Firefox it works directly after starting a novel browser but after some hot reloading it stops working. The following... Add solution -
CSS 2021-11-20 11:43:28
css style placeholder
input::-webkit-input-placeholder {/* Chrome/Opera/Safari/Edge */ /*styles here*/ } input::-ms-input-placeholder { /* Microsoft Edge */ /*styles here*/ } input:-ms-input-placeholder {/* IE 10+ */ /*styles here*/ } input::-moz-placeholder {/* Firefo... Add solution -
Javascript 2021-11-20 04:04:15
get script result chrome.tabs.executeScript
chrome.browserAction.onClicked.addListener(function(tab) { console.log('Injecting content script(s)'); //On Firefox document.body.textContent is probably more appropriate chrome.tabs.executeScript(tab.id,{ code: 'document.body.innerTex... Add solution -
PHP 2021-11-17 18:36:22
how to check if page opened from mobile or desktop
$useragent=$_SERVER['HTTP_USER_AGENT']; if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|pho... Add solution