This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
global navigator | |
*/ | |
function checkAudio(){ | |
var iOS = [ 'iPad', 'iPhone', 'iPod' ].indexOf( navigator.platform ) >= 0; | |
var microphone, speakers; | |
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) { | |
console.error( 'checkAudio', "enumerateDevices() not supported."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This class assumes it is in some kind of framework. | |
* It has 'data' passed in, then the $this->var function will get data either in the $this->data object if $name is string | |
* or it will return from an object passed in. | |
* It converts the object into an array and keeps a copy in cache for later use so the json_encode and json_decode is not called | |
* multiple times. | |
*/ | |
class View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/NTICompass/9375143 | |
/** | |
* Gets Date based on PHP formats into Moment Format. | |
* @param {[type]} m [description] | |
* @return {[type]} [description] | |
*/ | |
(function(m){ | |
/* | |
* PHP => moment.js | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create page in Wordpress called "Favorites" | |
// Access by calling /favorites?add_favorite=post_id, /favorites?remove_favorite=post_id | |
// in PHP this would be $link = '/favorites?add_favorite=' . get_the_ID(); | |
//page-favorites.php | |
if(is_user_logged_in()){ | |
$favorites = get_user_meta(get_current_user_id(), 'favorites', true); | |
if(!empty($_GET['add_favorite'])){ | |
if(empty($favorites)) $favorites = array(); | |
$key = array_search($_GET['add_favorite'], $favorites); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_lead - adds a new lead to the vicidial_list table with several fields and options | |
NOTE: api user for this function must have modify_leads set to 1 and user_level | |
must be set to 8 or higher | |
REQUIRED FIELDS- | |
phone_number - must be all numbers, 6-16 digits | |
phone_code - must be all numbers, 1-4 digits, defaults to 1 if not set | |
list_id - must be all numbers, 3-12 digits, defaults to 999 if not set | |
source - description of what originated the API call (maximum 20 characters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adv: { | |
findOne: function(args){ | |
return Loan.findOne(args) | |
.populate('broker') | |
.populate('borrower') | |
.populate('createdBy') | |
.populate('updatedBy') | |
.populate('notes') | |
.populate('investors') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findArgs(params, callback) { | |
params.args.sort = { key : 1, order: 0}; | |
var type = ''; | |
if(params.args.hasOwnProperty('type')) { | |
type = params.args.type; | |
delete params.args.type; | |
} | |
var finder = Meta.find(params.args) | |
.then( function(meta) { |
NewerOlder