Tim's Blog

Author: admin (page 1 of 2)

ifweallvote.com

I spent the weekend creating a site that holds daily mock presidential elections to inspire us to vote. Record voter turnout will change things for the better. Please use it, share it, get your friends to share it, get Cher to share it.

 

www.ifweallvote.com

HTML-NORMALIZER

I just wrote a library to help developers write DOM tests; specifically DOM assertions.  It allows you to express expected HTML (DOM structure) using React’s JSX.  All the details are in the readme.  The library is called html-normalizer and is available on npm and github. Here’s the link.  https://github.com/TimothyRHuertas/normalizer

 

Happy testing

 

Rails, Resque, Elastic Beanstalk and Ruby 2.1 (Puma) platform

There are several articles on using elastic beanstalk hooks to create and manage (start|stop|restart) background services (this example uses up-start) that govern rake tasks. This is not one of them; rather it is an amendment to those posts intended to provide you with an updated example. I recently upgraded my Elastic Beanstalk application to use Ruby 2.1 (Puma) and my services stopped working. I made some minor changes to get stuff working again.

Disclaimer: There are better ways to accomplish this (see rails sidekiq), but you may still find this useful. Consider it the “copy/paste path of least resistance” for upgrading older projects.

commands:
create_post_dir:
command: “mkdir /opt/elasticbeanstalk/hooks/appdeploy/post”
ignoreErrors: true
create_pid_dir:
command: “mkdir /var/app/current/tmp/pids”
ignoreErrors: true
files:
“/etc/init/resque.conf”:
mode: “000755”
content: |
description “Starts a Resque worker. For example: start resque.”

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 5 20

script
exec /bin/bash <<“EOF”
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)

. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)

PIDFILE=$EB_APP_DEPLOY_DIR/tmp/pids/resque.pid
LOGFILE=$EB_APP_DEPLOY_DIR/log/resque_workers.log
cd $EB_APP_DEPLOY_DIR
exec su -s /bin/bash -c “bundle exec rake workers:start >> $LOGFILE 2>&1” webapp
EOF
end script

post-stop script
exec /bin/bash <<“EOF”
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)

. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)

PIDFILE=$EB_APP_DEPLOY_DIR/tmp/pids/resque.pid
LOGFILE=$EB_APP_DEPLOY_DIR/log/resque_workers.log
cd $EB_APP_DEPLOY_DIR
exec su -s /bin/bash -c “bundle exec rake workers:killall >> $LOGFILE 2>&1” webapp
EOF
end script
“/opt/elasticbeanstalk/hooks/appdeploy/post/999_start_resque_job.sh”:
mode: “000755”
content: |
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
set -ex

initctl restart resque || initctl start resque
echo ‘resque restarted’

The pursuit of a dream

Leaving Snapfish.com…
About a year ago I left behind everything I knew and moved to San Francisco to take a job at HP Snapfish.  Looking back the experience changed my life (an explanation is the topic of another blog post that will never be written).  In my short time at the company I created a slide show, image editor, text editor and other widgets that are used by millions of people in many different countries.  I would like to thank the people at Snapfish who believed in me enough to give me such an opportunity.  Not for one second did I underestimate the amount of faith you had in me. 
 
Moving on…
I have often said to my friends that the reason we have yet to start a business is that we have not found an idea we truly believe in.  I hold the belief that when I feel I am on the verge of greatness it will take a powerful force to stop me.  About 2 months ago I was surfing YouTube when I stumbled upon a demo video for **** (let’s protect the names of the innocent).  I thought to myself “damn what a rad idea.”  I was so passionate about what I saw that I sent the following email to my friends:
 
These fools are headed straight to the top…Damn I wish I thought of that.
  
The next morning I woke up and thought to myself, “what are the odds that this company is in California and would let me be part of their team?”  I went to their website to see if they were hiring.  They were, but not for anything I was qualified for.  Nonetheless I continued to follow the company.  Something about what they were doing had won me over.  They were accepting applications for beta users.  I signed up.  A few days later I received an invitation to be part of their beta plan.  I logged in to their site and while I was there I saw that they were hiring ActionScript developers.  Finally an area where I could contribute!  I sent them the following email:
 
Hello

My name is Timothy.  I was given access to the ****beta today.  After browsing the site for a bit I was truly blown away!  The innovation the site brings … is inspiring.  I am sincerely interested in being part of the **** team.  

Please consider me for the ActionScript Engineer position.  Recently I have done some JEDI level ActionScript for Snapfish.com, but my skill set is much broader (see resume).
Thanks

Timothy Huertas
 
The next morning BAM!! I get an invitation to interview.  To make a long story even longer…I am leaving HP Snapfish in pursuit of a dream.  I really think I have found something that will inspire me to work with ferocity; a job that will move me to not want to do anything but “tear it up!” 
 
Stay tuned..

World Wide

Today I took a look at google analytics (this nifty program that lets me know where my visitors come from).  I was amazed to see that people all across the world look at this pit.  I mean I even had 8 visitors from Chennai (where is that)!

World Wide

To my guests:  It is an honor to have you.  Please leave comments; comments make my day! 

Billie Holiday Time

Okay so admittedly I have “slept” on Billie Holiday.  I just spent the past few hours rabidly digging through youtube looking at vids of her.  Does anyone still make music like this?  Thanks for posting this one peagahairy.

Random

This made me laugh.  That is a down seal! Thanks for sharing bnjlinks.

Talent Alert

This man is not super famous, but he should be. Super talented musician with the stage name “L” Debois. Here is a link to more of his videos. They are all good. The video below is his cover of “If this world were mine”. Feel it!

Lost Boys 2

Here is the trailer for the Lost Boys 2. Why? Oh why did they have to do this? Someone does not know how to quit when ahead.

Olderposts