Dan Schaefer is a web designer living in Ventura County, California. He’s been a part of several startups, doing everything from engineering to sales to marketing.

Dan's articles

  1. A CRM with Neo4j and REST

    In a previous post, we briefly looked at the Neo4j database and created some simple Ruby API methods that leveraged our knowledge of the Cypher query language. We started to put together a simple CRM (Customer Relationship Management) application in an attempt to show how easily graph databases can navigate in a highly connected world. In this article, we’ll continue building on the CRM example by zooming in on the management structure of a fictional sales organization and see how easy it is to make complex queries of the database.

  2. Create a Neo4j Graph Database Using the REST API

    In this two-part article, we’ll work with the most mature and popular graph database, known as Neo4j. Neo4j is written in Java, but has interfaces for many languages, including Ruby. In the spirit of flexibility, we’ll eschew the Ruby interface and instead take advantage of the REST API interface, which allows us to work with Neo4j using nothing more than the rest_client and json gems. The code in this article can therefore be refactored into other languages, like PHP, Python and perhaps even, JavaScript without much effort.

    To make this journey, this article will focus on setting up Neo4j to implement a simple CRM (Customer Relationship Management) for a sales department. We’ll briefly look at the Cypher query language that is used to communicate with Neo4j, and then we’ll put information into the database using the API.

  3. The Art & Science of Great Website Color Selection

    Website designers often struggle over the selection of colors. With roughly ten million discernible colors to choose from, it’s no surprise that the decision comes with a lot of angst.

    While some designers have formal training in art and graphics and are comfortable with decisions about color, the rest of us are forced to struggle with it. We look for rules and guidance and are met with opinions and platitudes.

    Some decisions may seem obvious.

    For example, you probably wouldn’t use blue for a Halloween-themed site. On the other hand, what color would you choose for a site dedicated to JavaScript programming?

    In this article, we’ll break down the color selection topic into three parts.

    We’ll begin by looking at some colors that indeed are hard-wired into our psyche (there’s not many of them) and then move on to discuss cultural and historical influences of color.

    Finally, we’ll see how easy it is to create analogous and complementary colors once we’ve selected a baseline color.

    Hard-Wired Colors

    Let’s begin by reviewing a few truths about us humans: Our bodies are the result of a billion+ years of engineering. The sole purpose of all this engineering is to help individuals survive long enough to perpetuate the species.

    Our base instincts are therefore hard-wired into our psyche as a means to ensure our survival. While our egos and sexual drive are the physical manifestations of this hard-wiring at work, more subtle qualities like our refined vision and associated ability to recognize patterns are used to help us gather all-important food.

  4. Uno! Use Sinatra to Implement a REST API

    The REpresentational State Transfer (REST) architecture provides a very convenient mechanism to shuttle data between clients and servers. Web services and protocols, like HTTP, have been using the REST architecture for many years, so it is a well-tested and mature concept.

  5. A Simple Admin for Padrino


    Padrino is an excellent website framework that makes it easy to implement complex web applications in a lightweight environment. Although it’s built on Sinatra, Padrino uses a Rails-like approach when generating code, establishing an organized file structure, and implementing database functionality.

    This article briefly introduces the Padrino framework and how it can be used to create a simple admin interface within a Sinatra-like environment.

    A Brief Introduction to Sinatra

    In a nutshell, Sinatra is a DSL (Domain-Specific Language) that processes HTTP connections. Specifically, Sinatra compares incoming user requests with entries in a list. When the first match is found, Sinatra executes the associated code and sends the results back to the user.

    For example, consider an HTTP GET request arriving on this URL:


    The DSL code within your Sinatra implementation may look like this:

    get ‘product/laces’ do
    haml :show_laces

    get ‘product/shoehorn’ do
    haml :shoehorn

    put ‘order/shoppingcart’ do
    haml :cart

    In the above code, the words get and put may look like Ruby commands, but in reality, they’re part of a filter that looks for HTTP verbs like GET, PUT, POST and DELETE.

  6. Eye-Catching Animations with GreenSock

    Eye-catching website animations can really grab attention and help increase conversions. Unfortunately, animations are never easy to create. Website developers spend many hours designing, reviewing, and revising their animations before turning them loose on the world. While many developers use the Adobe Flash platform to simplify the arduous task of tweening objects on a timeline, the lack of Flash support on mobile devices has many developers turning to JavaScript.

    To support the increasing demand for JavaScript animation, software vendors have created some amazing development tools. One of these vendors, GreenSock, provides some very useful and mature tools for tweening objects and putting them on a timeline. These tools are mature because GreenSock is not new to this business; they have created — and continue to create — animation tools for Flash ActionScript, and they have ported these tools to support JavaScript.

    In this article, I’ll briefly describe the GreenSock tools for tweening and timeline construction.

    A Brief Introduction to Tweening on a Timeline

    Animation developers use “tweening” to fill in frames of animation between two points in time. (The word “tween” is derived from the word “between.”) For example, when a developer wishes to animate a ball rolling from point A to point B, she need only draw a picture of the ball at each endpoint and let the computer fill in the frames between.

    Animation developers use timelines to move their animations along. For example, the developer specifies precisely when the ball gets released from point A and when it arrives at point B. Additionally, the developer uses an “easing” function to govern how the ball accelerates and decelerates along its path. Easing gives the appearance that the ball conforms to familiar laws of physics.

    Tweening on a timeline can get very complicated, especially when there are several objects moving around the screen, each with its own path, speed, and timeline. It gets even more complicated when revisions need to be incorporated after the design review. It turns out that it’s far easier to revise tweens and timelines programmatically rather than graphically. In other words, instead of arduously redrawing frames with revision, you simply change some of the numeric variables.

    The GreenSock Tools

    There are four main animation libraries from GreenSock: TimelineLite, TimelineMax, TweenLite and TweenMax. The “Max” versions extend the “Lite” versions in an object-oriented way, providing more functionality at the price of a slightly larger file size. You can generally use these libraries for free; however, I recommend purchasing a licensed tier and becoming a part of “Club GreenSock.” This provides you with the latest beta versions as well as some cool extensions. Also, your license applies to both the JavaScript and ActionScript versions.

    The names of the GreenSock libraries are self-explanatory: The “Tween” libraries allow you to tween visible elements around the screen, and the “Timeline” libraries allow you create independent timelines on groups of objects. Note that an object can be a part of more than one timeline.

    Let’s look at a simple example to see how tweening on a timeline works with the GreenSock tools.

  7. Visualizing Data with D3

    D3.js is a relatively new addition to the JavaScript toolbox. The three D’s stand for Data Driven Documents. You may have heard that D3 is just another JavaScript graphing library, but that’s only partially true. Indeed, D3 does produce excellent graphics, but its real value lies in its ability to respond dynamically to changes in […]