Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.
function foo ({ bar = 'no', baz = 'works!' }) {
return(`${bar}, ${baz}`);
}
console.log(foo({
function deferredObservable(initialValue, creator){ | |
if (!creator){ | |
creator = initialValue; | |
initialValue = null; | |
} | |
if ($.type(creator) === "string") { | |
var getUrl = creator; | |
creator = function(){ return $.get(getUrl); }; | |
} |
I hereby claim:
To claim this, I am signing this object:
function umountsmbfs(){ | |
for D in `mount -t smbfs | sed 's/.* on \(.*\) [(].*/\1/'`; do umount $D; done; mount; | |
} | |
function sawtailf(){ | |
group=$1 | |
hours=$2 | |
if [ -z "$hours" ]; then | |
hours=1 | |
fi |
declare module 'video.js' { | |
namespace videojs { | |
interface Player { | |
ima(options: any): this; | |
} | |
} | |
} |
import videojs = require('video.js'); | |
declare module 'video.js' { | |
namespace videojs { | |
interface Player { | |
ima(options: any): this; | |
} | |
} | |
} |
declare module 'video.js' { | |
namespace videojs { | |
interface Player { | |
ima(options: any): this; | |
} | |
} | |
export default videojs; | |
} |
import videojs, { VideoJsPlayer } from 'video.js'; | |
const Plugin = videojs.getPlugin('plugin'); | |
// default setting | |
const defaultSetting: VideoJsMarkerPluginSettings = { | |
markerStyle: { | |
width: '7px', | |
'border-radius': '30%', | |
'background-color': 'red' |
javascript:with(document.querySelector("video")){ | |
removeAttribute('disablePictureInPicture'); | |
requestPictureInPicture(); | |
} |