Skip to content

Instantly share code, notes, and snippets.


Helson Taveras helsont

View GitHub Profile
helsont /
Last active January 15, 2018 17:07
Moves backups from a primary disk to a secondary disk when primary becomes full. Removes the oldest file from the secondary drive when secondary becomes full.
is_almost_full() {
# Get percent usage of current directory in bytes
PERCENT=$(df -B1 `pwd` | awk 'END{print $5}')
View assertKeys.php
public function assertKeys($expected, $array)
// we want to find if there are differences between the expected keys
// and what the $array has provided. array_diff_key does the job but
// it is incomplete because it is unidirectional:
// array_diff_key(['a', 'b'], []) !== array_diff_key([], ['a', 'b']);
// [] !== ['a', 'b']
helsont / ActionCreator.js
Last active September 19, 2017 19:28
The main file (real code) is ActionCreator.js
View ActionCreator.js
* A redux object with data on the action being sent
* @param {String} actionType The "type" of the redux action
* @param {Object} data Any data that will passed to the reducer
* @return Object The redux action
const action = (actionType, data) => {
return {
type: actionType,
helsont / on-jsx.markdown
Last active September 14, 2017 16:51 — forked from chantastic/on-jsx.markdown
JSX, a year in
View on-jsx.markdown

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

View gist:9ae023f5446a7bd94faab88c93ff72ca
web_1 | [Tue Oct 11 01:51:26 2016] [200]: /images/riley-99-banner.jpg
Exception in thread Thread-3:
Traceback (most recent call last):
File "", line 810, in __bootstrap_inner
File "", line 763, in run
File "compose/cli/", line 149, in tail_container_logs
File "compose/cli/", line 179, in wait_on_exit
File "compose/", line 239, in wait
File "site-packages/docker/utils/", line 21, in wrapped
File "site-packages/docker/api/", line 441, in wait
View docker-compose.yml
version: '2.0'
build: .
- "8000:8000"
- mysql
- .:/app
helsont / syncPromise.js
Created August 11, 2016 20:43
Utility to in order iterate through an array of promises and return an array of results after completion.
View syncPromise.js
'use strict';
* Sync promise
* Utility to in order iterate through an array of promises and return
* an array of results after completion.
* Usage:
helsont / .eslintrc.js
Last active June 5, 2016 19:11 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
module.exports = {
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
"plugins": ["react"],
helsont /
Created May 14, 2016 17:12
If you attempt to simultaneously ssh into the sam vagrant box from several different terminals, you will more often than not get an error message that the box is unavailable. This script sleeps for a random period of time and then executes vagrant ssh, resolving the issue.
SLEEPTIME=$(echo "$SLEEPTIME/10" | bc -l)
printf "waiting..."
# printf "time: %f\n" "$SLEEPTIME"
vagrant ssh
View gist:e015eda6311915b67ec3
'use strict';
module.exports = function(Model, options) {
let property =;
// Use 'ignoreFilters' to access deleted data.
Model.observe('access', function filterDelted(ctx, next) {
if (!ctx.query.ignoreFilters) {
if (!ctx.query.where) {
ctx.query.where = {};