Link

I have no reason to call this “intellectual property” anymore. I have released the code that drives this cool little demo: http://landr.co/brandr/ This project was about 2 weeks of coding, testing, and understanding—having late nights, and a lot of white-boarding to figure out the best way to extract colors from brands. Notice, I say “brands”. It’s not just colors from an image, it’s the human interpretation of a gestalt; and that’s why it is a tough problem. Click on the title above, or here for the Github repo.

Text

Installing suPHP with Plesk 11 on Media Temple DV4

I ran into major dependency issues trying to follow this tutorial provided in the Media Temple knowledge-base. Normally it is recommended to install suPHP by compiling it from source (as mentioned in the tutorial), but mainly because of the mode that suPHP is put into during the installation. The reckoning for suPHP is well-put here, with the three modes of operation being:

  • owner: Run scripts with owner UID/GID
  • force: Run scripts with UID/GID specified in Apache configuration
  • paranoid: Run scripts with owner UID/GID but also check if they match the UID/GID specified in the Apache configuration

The advantage of compiling from source is that suPHP can run in paranoid mode—however, as the previous link states: Although suPHP states that the default mode is “paranoid”, the libapache2-mod-suphp is installed in “owner” mode by default. When suPHP is installed in “owner” mode, the directive suPHP_UserGroup is not recognized which is required for “force” or “paranoid” mode.

Running suPHP in owner mode doesn’t seem all-that-bad, considering it is in fact the default for some installations. However, the comment about not having access to the “suPHP_UserGroup” within your configuration file is true, and if you try to restart Apache with it in there (as the Media Temple tutorial suggests), it will result in an error, and possibly crash your server.

My workaround is to remove any of the lines that include “suPHP_UserGroup”, and simply use yum to install suPHP, which lets you skip steps 1-4 in the tutorial.

yum install mod_suphp
Link

I couldn’t understand why cash-based receipts have not been exploited. It is so seemingly simple to return your “used” stuff, if only you had that magic receipt. Let me know what you think!

Text

Why I can Judge Your Design Work

I write code. I love logic. And I still know what beautiful is.

Of course, there is no true judge of artful things. However, artists still have a tendency to believe their eyes are not only different, but a better judge of artistic character, aesthetic presence, and visual impact. This is wrong, and I’ll tell you why.

I may not be a wonderful chef, but I know when my steak is under-cooked, or over-seasoned. I am not on any New York Times best-seller list, but I can tell who is a good novelist after a couple chapters. I can’t paint, but it is easy to see when someone has a grasp on lighting, shapes, and colors. I don’t have many music abilities, but I could spot the difference between a high school band, and a renowned symphony orchestra.

Being a good creator has no affect on your ability to consume, and no affect on your ability to judge– it may only affect your historical knowledge or appreciation of the subject matter. When you compose a piece of art, whether it be digital or mechanical, on canvas or on film, you must accept the interpretation of the consumer.

If you can bring new perspective to your artwork by telling a story, or bringing forth some element of enlightenment in those who consume it, you are truly a great artist. But if you think that because someone doesn’t see it your way, or find something more or less beautiful than you, do not blame it on their experience, their lifestyle, their career, or your ignorant predispositions about their ability to artistically, aesthetically, or visually intake something– blame it on your shitty art.

Tags: art
Text

Creating Rows with ExpressionEngine and a Grid

Below is an image from my digital library that I developed to help me organize my research for an upcoming book. It uses a responsive grid, and I’ll show you how to create it using Bootstrap and methods available within ExpressionEngine (no modulo!).

image

Let’s take a look at how Bootstrap implements their grid (knowing other grid systems are similar), and in particular, a 4-column grid.

<div class="row">
  <div class="span3"></div>
  <div class="span3"></div>
  <div class="span3"></div>
  <div class="span3"></div>
</div>

The only complexity within ExpressionEngine you face is that you have repeating elements for the “span3” class, but the rows also need to repeat as the page continues! The switch statement comes to the rescue in a somewhat unexpected way.

<div class="row">
  {exp:channel:entries channel="books" orderby="title" sort="asc" dynamic="no"}
    <div class="span3"></div>
    <div class="span3"></div>
    <div class="span3"></div>
    <div class="span3"></div>
    {switch='|||</div><div class="row">'}
  {/exp:channel:entries}
</div>

Why is this a little tricky? Well, even though the entire EE channel loop appears to be wrapped by a row element, it’s not. The closing (and opening) of the first, and all subsequent rows, is handled in the switch statement. The last and final closing “</div>” is actually closing a row that came from the switch statement.

If you are used to hardcoding this type of stuff in PHP, your mind may instantly jump to using some type of modulo plugin to do this, but fortunately you can scratch that complexity right out. Here is what my entire page looks like, using Assets for the image.

{embed="partials/_head"}

<h2>Books</h2>

<div class="row">
  {exp:channel:entries channel="books" orderby="title" sort="asc" dynamic="no" disable="custom_fields|member_data|pagination|trackbacks"}
{if no_results} <div class="span12"><p>No entries yet.</p></div> {/if} <div class="span3"> {research_cover} <a href="{path='book/entry/{url_title}'}"><img class="img-polaroid img-rounded" src="{url:tall}" alt="{alt_text}"/></a> {/research_cover} <h5><a href="{path='book/entry/{url_title}'}">{title}</a></h5> <p class="center"><small>{if book_bought}&#x2713; you own this{/if}</small></p> </div> {switch='|||</div><div class="row">'} {/exp:channel:entries} </div> {embed="partials/_foot"}
Text

Timebomb.it is a Time-sensitive Short Link for Passwords

I built timebomb.it a long time ago and gave it a quick refresh this afternoon. I still see this problem popup all over the place– people sending passwords in emails. Worse yet, starting the email with, “here is the password”. All it takes is access to someones email account to retrieve all these passwords, or bank account numbers, or social security numbers.

image

This mobile-friendly website allows you to make confidential information available for only 1 hour, 1 day, or 1 week. When the time is up, so is the data, and it is erased forever. Everything runs under an SSL certificate (HTTPS) so everything transmitted is encrypted, and secure. Also, every link comes in a clean, sendable format (eg. “https://timebomb.it/637jv8gfmd”). Give it a try, and save yourself (and your clients!) from a security catastrophe down the road.

Photoset

I added an ultra low-profile sliding table top (on an angle!) to my desk this weekend. It collapses just enough so my cup of water always has a spot on a nice felt pad. It has an 18” throw which is perfect for a laptop, some books, or bundles of papers. It slides, it floats, it’s simple, and only cost $28 worth of parts at Home Depot. Even with that fancy chair from Target I am still sub-$200 on this desk (see my first post about this).

Text

Git Video - Supplementing Github Commits with Video!

Special thanks to the team over at Nimbb for sponsoring this project with some free video space. A company willing to go out of the way for independent developers deserves a look— so check them out!

Ever come back to a project and completely forget how all the pieces fit together? Supplement your commits with Git Video.

image

That half-sentence you throw into the commit message usually does no help when you have walked away from a project for more than a day. Projects take major evolutions— architecture, ideologies, and approaches to problems are constantly changing, and documenting them becomes hard. A short video connected to each commit on Github is perfect, and lets you use gestures, inflection, and visuals to help you remember what state the project is in at that point in time.

image

Doing this once a day will help you battle that incessant, twenty-minute, “back into the groove” you usually have to entertain when switching between projects. It was created in a night on Rails, uses Github’s API, designed with Bootstrap, launched on Heroku, monitored with New Relic, and relies on Nimbb for the video embedding.

Quote
"

Before the “lean startup methodology” made beta testing de rigeur, companies would perform “pilots” with little to no feedback from the front lines. This strategy of ignorance often led to the development of technology that actually made educators less efficient.

As a teacher and one allowed into the inner sanctum of ImagineK12, I can tell you that today’s entrepreneurs are different. They care about listening to teachers and acting on insightful, productive feedback. They know that it’s not enough to be a respectful and good listener; these entrepreneurs have learned to let teachers know when they act on the feedback they’ve received.

"

— Jennie Dougherty, a teacher in Brockton, Mass., who cofounded Edupgrade and blogs at BetaClassroom.

Text

Simple Status Ticker for API Endpoints

When you are deploying code left-and-right, even in a test-driven development cycle, sometimes you still want the piece of mind that your website is responding. In my case, this is specific to API endpoints and different API environments we run our products on.

Status Ticker

This script allows you to leave a mini terminal window on your screen that will refresh the status of a website at an interval of your choice. I use two gems, the first is to make the text colors pretty, and the second is for making the HTTP calls- install them like so:

> gem install httparty
> gem install terminal-display-colors

Below is the code, which can also be found on this Github gist.

require 'HTTParty'
require 'terminal-display-colors'
require 'json'

# set your endpoints!
endpoints = {
  "Google" => "http://google.com",
  "Twitter" => "http://twitter.com"
}
# seconds to sleep between pings
sleep_seconds = 10

buffer = []

def diff start, finish
  ((finish-start) * 1000.0).round(2)
end

def print_flush str
  print str
  $stdout.flush
end

while(true)
  # clear terminal
  buffer << "\e[H\e[2J"
  response_times = []
  # loop endpoints
  endpoints.each do |name, url|
    begin
      t1 = Time.now
      response = HTTParty.get url
      t2 = Time.now
      if response.code == 200
        response_times << diff(t1,t2)
        buffer << "#{name.upcase} : " + response.message.green + " (#{response_times.last}ms)".yellow
      else
        buffer << "#{name.upcase} : " + response.message.red
      end
    rescue => e
      buffer << "#{name.upcase} : " + 'Connection Error'.red 
    end
  end

  buffer << "\n"
  # display avg and max response times
  unless response_times.empty?
    buffer << "avg : #{(response_times.inject{ |sum, el| sum + el }.to_f / response_times.size).round(2)}ms".cyan
    buffer << "max : #{response_times.max}ms".cyan
  else
    buffer << 'No response times.'.cyan
  end
  # send buffered text to terminal
  puts buffer.join("\n")
  buffer.clear

  # sleep
  sleep_seconds.times
    sleep 1
    print_flush '.'
  end
end

To use the ticker, take the code and put it into a file named `status.rb` and run the following in terminal from the directory the file is located:

> ruby status.rb

To exit the ticker, use control+c on your keyboard.