Skip to content

Instantly share code, notes, and snippets.

View RonnieSan's full-sized avatar

Ronnie Garcia RonnieSan

View GitHub Profile
@RonnieSan
RonnieSan / keybase.md
Last active October 16, 2017 15:04
Keybase

Keybase proof

I hereby claim:

  • I am ronniesan on github.
  • I am ronniesan (https://keybase.io/ronniesan) on keybase.
  • I have a public key whose fingerprint is 23E7 4136 A591 A22B DC66 2224 A1A8 EDB6 635D F036

To claim this, I am signing this object:

@RonnieSan
RonnieSan / cloneChildren
Last active July 20, 2022 17:50
Clone children in a react component recursively and add props based on a filter
// ----------------------------------------------------------------------
// CLONE CHILDREN
// Recursively clone children and add props to filtered elements
// ----------------------------------------------------------------------
// Import dependencies
import React from 'react';
// Array.some polyfill
if (!Array.prototype.some) {
@RonnieSan
RonnieSan / rethinkdb-filter.js
Last active August 29, 2015 14:27
Dynamic Filtering for RethinkDB
/*
* DYNAMIC FILTERING FOR RETHINKDB
* Accepts an object with property values to match
* Array values will match any of
* filters = {name: 'Iron Man', identity: ['Tony Stark', 'Anthony Stark']};
*/
r.table('test').filter(function(row) {
// Create a placeholder for the predicates
var predicates = [];