Skip to content

Instantly share code, notes, and snippets.

View diegochavez's full-sized avatar
🎯
Focusing

Diego Chavez diegochavez

🎯
Focusing
View GitHub Profile
@diegochavez
diegochavez / examples.md
Created November 24, 2016 15:08 — forked from mattpodwysocki/examples.md
RxJS Demos
@diegochavez
diegochavez / multiFilter.js
Last active January 16, 2022 12:38 — forked from jherax/filterArray.js
Multi filters an array of objects
/**
* Multi-filter an array of objects
* @param {Array} array : list of elements to apply a multiple criteria filter
* @param {Object} filters: Contains multiple criteria filters by the property names of the objects to filter
* @return {Array}
*/
function multiFilter(array, filters) {
let filterKeys = Object.keys(filters);
// filters all elements passing the criteria
return array.filter((item) => filterKeys.every((key) => (filters[key].indexOf(item[key]) !== -1)));
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
@diegochavez
diegochavez / placeholder.js
Last active December 18, 2015 05:29 — forked from manfromanotherland/gist:2228169
Useful jQuery code to fix the place holder support
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {