start new:
tmux
start new with session name:
tmux new -s myname
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
| if (downloadRatio < 1.0) { | |
| self.debug.log("Download ratio is poor."); | |
| if (current > 0) { | |
| self.debug.log("We are not at the lowest bitrate, so switch down."); | |
| self.manifestExt.getRepresentationFor(current - 1, data).then( | |
| function (representation1) { | |
| self.manifestExt.getBandwidth(representation1).then( | |
| function (oneDownBandwidth) { | |
| self.manifestExt.getRepresentationFor(current, data).then( | |
| function (representation2) { |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| M[16],X=16,W,k; | |
| main(){ | |
| T(system("stty cbreak")); | |
| puts(W&1?"WIN":"LOSE"); | |
| } | |
| K[]={2,3,1}; | |
| s(f,d,i,j,l,P){ |
| # Keep in mind that when asking for a `return` after another, only the first one will be output. | |
| # This example is meant as a simple starting point, to show how to get the information in the simplest available way. | |
| # Google Chrome | |
| tell application "Google Chrome" to return URL of active tab of front window | |
| tell application "Google Chrome" to return title of active tab of front window | |
| # Google Chrome Canary | |
| tell application "Google Chrome Canary" to return URL of active tab of front window | |
| tell application "Google Chrome Canary" to return title of active tab of front window | |
| # Chromium |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');Stream audio to any Sonos component via AirPlay using a Raspberry Pi (Model B, Raspbian Jessie) and the following software:
Paprika doesn't have their API documented, so this is me reverse-engineering it from an Android device