Skip to content

Instantly share code, notes, and snippets.

const mongoose = require("mongoose");
const claimSchema = mongoose.Schema({
billed_insurances: [
{ type: mongoose.Schema.Types.ObjectId, ref: "Insurance" },
],
});
const Claim = mongoose.model("Claim", claimSchema);
const insuranceSchema = mongoose.Schema({
@jruck
jruck / gist:4270084
Last active January 16, 2023 01:30
WP: Minimal wp_oembed_get
// Minimal YouTube & Vimeo embeds
function wp_oembed_get( $url, $args = '' ) {
if(preg_match("/youtube.com\/watch\?v=([^&]+)/i", $url, $aMatch)){
return '<iframe width="640" height="360" src="http://www.youtube.com/embed/' . $aMatch[1] . '?loop=1&modestbranding=1&rel=0&showinfo=0&autohide=1" frameborder="0" allowfullscreen></iframe>';
}
if(preg_match("/youtube.com\/watch\?feature=player_embedded&v=([^&]+)/i", $url, $aMatch)){
return '<iframe width="640" height="360" src="http://www.youtube.com/embed/' . $aMatch[1] . '?loop=1&modestbranding=1&rel=0&showinfo=0&autohide=1" frameborder="0" allowfullscreen></iframe>';
}