How to save a string to S3 using PHP

I recently used Elance to commission the creation of a PHP function that takes a string as input, creates a text file, saves it to S3, and finally returns the URL to the text file.

I’m using this function to create a virtual cookie that essentially gives me infinite storage. It’s pretty darn useful. Rather than bogart this nifty function I’m giving it to you dear Internet comrade. Enjoy! 🙂

This function requires the Amazon Web Services SDK for PHP.

TIL Texas Renaissance Festival Edition: Doublets & Wine Slings

We had a blast at the Ren Fest last weekend. While we were there I noticed one pesky problem. How does one free their hands with a bottle of mead in one hand and a glass in the other! It’s a common problem to be sure, because there’s a special knot called a bottle sling designed just for this purpose of carrying your bottle! Brilliant! 🙂

I also learned that a renaissance man’s doublet was not just a fancy shirt. It was also functional, or at least the original doublets were. Doublets were padded and worn under armor to cushion any receiving blows. Here’s a picture of a fencing doublet I took the Metropolitan Museum of Art back in 2009.

New York & Boston 2009

Tweet Button Shows 0 Fix

Twitter has a fancy widget/button called the Tweet Button that allows your readers to click a button to tweet about your webpage. It includes a count of how many people have tweeted about your page, similar to Facebook’s “like” button.

If your tweet button count seems to be stuck at zero try adding the data-counturl field. Its value should be the URL of the page you want the button to count (most likely the same value as your data-url field). Your tweet button code should look something like this:

<script src="http://platform.twitter.com/widgets.js" type="text/javascript"> </script>
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://friendorfollow.com"
data-via="FriendOrFollow"
data-counturl="http://friendorfollow.com"
data-text="Who are you following that's not following you back? Find out here:"
data-related="DustyReagan:Creator of Friend or Follow,Cesart:Designer of Friend or Follow"
data-count="horizontal">Tweet</a>

This example above is obviously for FriendOrFollow.com. Just swap out the details with your own site or page.

TIL The 2-Step, Dearth, Gaslighting, & Tamping

It’s been awhile since I wrote my last TIL (Today I Learned) post. A few things happened that have prevented me from posting:

  1. I couldn’t think up a good post one day.
  2. I worried these type of posts were not appropriate for my mostly how-to blog.
  3. I wasn’t sure these TIL posts provide much value to other people.

I’ve thought about these issues a bit in my spare brain cycles and have concluded: I’m WAY over thinking it. 🙂 I enjoy writing these posts so they shall continue. I have also decided to forgive myself for missing a day or 30. I’ll post when I feel like it! 😉

To make up for my short post hiatus, here a few things I’ve learned since my last post.

The 2-Step

Sharlee and I have started taking dance lessons at Go Dance Austin. We’ve taken 1 private lesson so far and I finally learned how to 2-step correctly. I tried to find a video on 2-stepping to post here, but I couldn’t find a good one quickly. In any case we had a great time.

The Definition of Dearth

Somehow I’ve amassed a group of highly literate friends. Go me! I learn and forget new words from them nearly daily. The other day one of my friends sent me a text message with the word dearth in it. I looked it up. A dearth is a scarcity or lack of something.

Gaslighting

The term gaslighting is one of the most interesting things I learned last week. If you try to trick someone into questioning their own memories, that is gaslighting. For example, you might invite a friend to your house to watch a movie and ask them to bring peanuts. A week later when they show up at your door with a bag of peanuts you say, “Are you trying to kill me? I’m allergic to peanuts! I told you bring anything BUT peanuts.” The victim will then question their own memory. I’m familiar with this behavior from movies, but I never knew there was a term for it. I learned this term killing time reading Reddit comments.

How to Properly Tamp Espresso

At Conjunctured we rent commercial grade coffee equipement from Casa Brasil. They come out occasionally to service the equipement, restock our beans, and answer any questions we have on how to use the equipment.

While watching the barista show our coworkers how to pull a shot, I discovered I’m not applying nearly enough pressure when I tamp my espresso coffee grounds. The recommended pressure is 40lbs! That’s a pretty solid push. Here’s a video I found that sums up what I learned about tamping the portafilter.

TIL Summize.com is Dead

TIL (Today I Learned) Summize.com is dead. Well, at least the redirect to search.twitter.com is dead.

Summize is the 3rd party Twitter status search engine Twitter acquired. Being an old school Twitterer I’m use to typing in Summize.com in my browser’s address bar and having it redirect me to search.twitter.com. Plus it’s less to type. Now either the redirect is down temporarily, or Twitter has officially turned off the lights for the old brand name.