Trying to figure out Stripe, being new at this not all that smart

I’m building a website to sell stuff I want to buy. It doesn’t really matter what I’m selling right now – I just need to set up the store so I can sell anything.

Stripe offers a nice system for setting up online payments. Their API is very well documented, if only I was better at using it/reading tech docs.

So far I have setup the front page of my website using HTML5 and have followed their template for creating a payment form. The next step is to create an action that the sends the payment data to my server/stripe’s server/whatever and processes it.

I’m a bit stalled here, because I have their template of the code, but I’m not sure which parts I need to change to make it work for me, and I’m not sure where to put it. I’m also not sure how to test it. Most of all, I’m having trouble keeping my concentration on this project, because I don’t know what to do next or where to find info. Online help for this is pretty thin – Stripe doesn’t have a developer forum, just a chat room and a curated q&a page.

So, I guess my plan is this:

1. Test the payment form that I have made
2. Create the php action
3. Figure out where to put the action
4. Test it
5. Repeat as needed.

 

Would you like to receive updates by email?

Writer’s Block?

I’m teaching a kid to ride a bicycle. “Be careful not to run into that mailbox”, I tell her. She doesn’t know how to steer yet, so she zeroes in on the mailbox, focussing so hard on not hitting it that she rams it head on. If I hadn’t said anything, she’d be fine.

You didn’t come here to read about bicycles, so what’s my point?

You’re trying to write something, doesn’t matter what it is – let’s say there’s a guy in your department, he’s unpleasant, he does his job badly. You want to get rid of him. So you’re writing a report to your boss about him. But there’s all these things you can’t say – you don’t want to look like a snitch. You can’t be sarcastic and snippy. You can’t be insulting or angry. You can’t be unprofessional. So this half page report takes 8 hours to write, every sentence rewritten a dozen times.

Or you’re writing a blog post. You’re outraged, and everyone loves a good rant. If you can throw some useful info in there as well, it’ll be a hit, right? But you’re not free to write what you want. You want to point fingers and name names. You want to accuse the guilty and call them to account. You want everyone to know and to destroy their reputation. But you’re afraid of the backlash, that people won’t trust you anymore, or that they’ll write a rebuttal that says worse things about you.

Every time you go to write, you’re choked by all these things you can’t say. Your funny, angry tirade becomes a dry recitation of facts.

So what’s my point?

First, to get past writers block, one way is to make shorter the list of things you can’t write. After all, no one is forcing you to publish anything. You can write any vile, mean-spirited, angry thing you want, if you store it on an encrypted hard drive under a folder called “Tax Documents ’05 to 09”.

Second, I’m not hard enough to take my own advice – I stopped writing on my blog shitjobtales.blogspot.com because all the things that made good stories were things that would cause my parents and my brother to give me a hard time. Hey, maybe they had a point. Probably they did. But I got so tired of having to censor myself for them that I stopped writing. Sure, I could just disregard them and write what I wanted anyway, but every time I write something raw online, it causes fights in my family. So this is why I’m into technical writing now. Just the facts, as clear as possible. No emotions, no opinions. Does it still have value?

 

 

 

 

Would you like to receive updates by email?

KZ305 Carburetor Removal and Inspection

First, a question and an answer.

Is it safe to use red Permatex to seal a carburetor? NO IT IS NOT.

This tutorial details the removal and inspection of carburetors from a 1982 Kawasaki KZ305b LTD.

This is the carburetor.

side view motorcycleRemove the seat.

seat removedRemove the air box and tool kit.

Remove the battery.

Turn the petcock to “off” and disconnect the fuel hose from the fuel tank.

Remove the fuel tank.fuel tank removed

Remove the two bolts holding the bigger part of the air box in place. The one on the right has electrical contacts under it – remember to replace them when you put this back together.air box screws

Loosen the screws on the carb boot clamps. Sorry I didn’t get a better picture than this; there are four of them, one on each carburetor boot.

Now is a good time to drain gasoline out of the float bowls. Connect a length of hose to the float bowl drain.

carb boot screwLoosen the drain screw. You’ll have to pull it most of the way out.float bowl drain screw

Pull off the rubber hose connecting the engine to the air box.hose between engine and air box

Pull back the air box, and wiggle the boots off of the carburetor. Carefully pull it out of the frame.

This is the throttle cable. Loosen the locknut, push the spring mechanism back with your thumb as shown, and screw out the end of the cable housing. throttle cable

Then pop the end of the cable out of its bracket. Now the carb is totally disconnected from the bike.pop out cable end(On this occasion, I am not planning to rebuild or thoroughly clean the carburetor. I’m only inspecting them.)

Lay the carb bodies upside down on a flat surface. Hold them over a pan as you turn them about, as there might still be gasoline sloshing around inside.

Carefully remove the 4 screws holding the float bowl in place.

carb bodies pside downWARNING: If it has been several years since the carb was last disassembled, the next steps will almost certainly ruin the seal and you will need to replace it.

Give the bowl a sharp rap with the end of a screwdriver or something to knock it loose. If, as with mine, it’s sealed with gasket maker, use a penknife to pry it off.

Inspect the inside of the bowl. As you can see, too much gasket maker was used, and it was not a gasoline-safe type. The parts exposed to gas have swollen up and this is causing the motorcycle to run badly.

inside of float bowl filled with permatexNext post I’ll post pics of the jets and seals that you need to inspect.

Would you like to receive updates by email?

Ideas

A business making custom bushings for cars. It’s possible to get bushings that aren’t quite right for 12 bucks, so why not sell bushings that are perfect for 24?

A site that sells women’s jeans. Most women’s jeans on the market have unusuable pockets, bejazzling, and tasteless embroidery, and holes ripped in the knees because of “fashion”. I want to sell jeans with following goals:

1) Make your ass look awesome

2) Have pockets deep enough for your wallet and phone so that they complement your lines instead of ruining them.

3) Reinforce the crotch, because it constantly rips. Or find a way to make them fit so the crotch doesn’t rip.

4) Optional: Make a kevlar, kneepad version for motorcycles.

Convince someone to sponsor you as a racecar driver in hornet racing, and win as often as possible.

Build bicycle wheels.

Rent yourself out to people who are tired of their roommates. Live in their house rent free and make life uncomfortable for the unwanted housemate.

 

Would you like to receive updates by email?

Sell me this

Solution:

A metal board, similar to a whiteboard. Strongly magnetized so that nuts and bolts stick to it. Grease pen to label nuts according to where they came from.

Problem:

While doing an engine swap on a 1984 Corolla hatchback this weekend, I kept misplacing bolts. As much as I was careful to put them in a safe place or screw them back onto the motor, sometimes I would put bolts from one engine part in the same spot as nearly identical, but much higher grade, bolts from a different part. They would get mixed up. I want a better way to organize these things, so as to keep my work area orderly and keep track of pieces, for best results when putting the car back together.

Potential issues:

  • The board will be quite heavy, so it will need a sturdy backing, and will have to be mounted firmly.
  • The magnets must be quite strong, so that everything doesn’t fall off in a massive mess if it gets jostled (Think about slamming the refrigerator door).
  • Magnets are weird as all get out and often cause unforeseen problems.

Anything else? Let me know in the comments.

I would pay $50 for this item. A good size for me would be 100cm by 60cm.

 

Would you like to receive updates by email?

Look, I made a thing!

Racing cars is a lot of fun. What’s less fun is doing arithmetic by hand for an hour to find out how well people did. Fortunately, we now have the technology to ease this pain.

This guy I go out with, Quinn, is into drift racing. When he doesn’t have a car handy, he judges events. I’ve spent a fair bit of time chatting with him and other judges about how tedious the process is due to all the arithmetic required to add up scores during qualification rounds.

I wrote a program to make it easier. This is a Java applet which you can download at Github. You start an event, add drivers, score them, then click the big button to get a list of who made it through to competition, and who’s out. Simple, clean.

A screencap from the Capital Drift program.

Possibly too simple – currently, if you make a mistake in entering scores, there is no easy way to correct yourself. You have to delete the driver in question and start again. I’ve been thinking carefully about the best way to correct this issue, but I haven’t decided yet.

Nevertheless, the thing does what it is supposed to do and is available for beta testing. It will be tested this Saturday the 15th at Western Speedway, during Capital City Drift. If they like it well enough perhaps they’ll keep using it.

If you are in charge of any similar event, please feel free to download, recode for your own purposes, and let me know how it went.

Would you like to receive updates by email?

Getting Started With CakePHP

Here’s a couple of things I did wrong when trying to use CakePHP, for your benefit.

Several months ago I applied at a company called Radar Hill, which uses Cake as their main framework. Naturally I set about learning how to use it as soon as possible. I didn’t do very well. I it on Rocketships, but couldn’t figure out how to make it run – there were a variety of problems that I’m not quite experienced enough to recognize.

Then I tried it locally on my MacBook. I made progress, but the database part stumped me until I found out about MAMP, which got me a little further. But it still wasn’t what you’d call a success. Finally, the job interview at Radar Hill rolled around, and I was not hired, mainly because of my inexperience with PHP. Sigh. I tried!

However, the guys who interviewed me were very encouraging, and said to keep trying and stay in touch. One, Jamie, gave me some tips on how to run it on the Mac. His instructions worked perfectly.

 

First Mistake

.htaccess files sometimes don’t copy and paste in the Mac finder, because the . at the beginning of the file name renders them invisible (except when it doesn’t).

The solution was found here:

Probably the hardest to do but uses the least amount of work and has the most potential to go wrong, that is the Terminal Method. If you open up terminal (Applications > Utilities) and type the following:

 

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

 

This will show you all of the hidden files and folders on your operating system. If you want to reverse the command replace TRUE with FALSE.

Then check the Cake files to make sure that all 3 .htaccess files are present – as detailed by this very helpful post on Stack Overflow. There should be one at the top level of your cake directory, one in /app, and one in /app/webroot.

Second Mistake

I was putting files in all sort of random places, trying to find a way that worked. Jamie said to unzip the Cake download into /MAMP/htdocs, replacing anything else in that directory. This is probably a dumb newb mistake, but I’m sure at least one other person has made it.

What Jamie Said

#1: Download and install MAMP:

It’s an “out-of-the-box” LAMP environment for the Mac. It’s all I ever use.

#2: Start MAMP, and then go to the homepage, which by default is:

#3: Click on the “phpMyAdmin” tab at the top. You can also get there
directly:

Create a new database and call it whatever you want – something descriptive.

#4: Download the latest version of CakePHP 2.2, currently RC1, from here:

#5: Extract the archive and put its contents into
/Applications/MAMP/htdocs (replace whatever’s there).

Open the database config file for editing, which is at (relative to htdocs):

app/Config/database.php.default

#6: In the DATABASE_CONFIG class in the file you’ll see this array,
which is the default DB config:

Change it to this:

#7: IMPORTANTLY: don’t forget to replace “your_database_name” above with
the actual name of the DB that you created.

#8: save that file as database.php, rather than database.php.default

#9: Browse to: http://localhost:8888/

If all went well you should see the ‘vanilla’ Cake installation.

– Jamie

 

 

 

Would you like to receive updates by email?

Here’s What You Should Do This Weekend

Take a rusted, rotten shell of an old car.

An old car with weeds grown into the grille, probably hasn't moved in years. Source

Remove all the junk from inside of it.

A cleaned out race car shell painted black on the outside and red on the inside.Source

 

Set it under a nice maple tree.

Battered old truck under a maple treeSource

 

Bolt in a racing seat.

Corbeau racing seatSource

 

Remove the steering column, and replace it with a laptop desk on a swivel.

A mount that could be used to install a laptop on the dashboard.Source

 

Run an extension cord out from the house.

A beautiful extension cord, with fabric insulation instead of plastic.Source

 

Remove what’s left of the engine, and replace it with a refrigerator.

A small, portable chest stye refrigerator.Source

 

Hang out in your new fort and watch Top Gear.

Me, in a BMW, watching Top Gear on my laptop.Source

 

Would you like to receive updates by email?

Things No One Tells You

You have to reach down to loosen the strap on clip-style bicycle pedals. Who knew. No one ever mentioned this to me – they either weren’t aware or didn’t know. “Google it” isn’t a helpful answer. It never even occurred to me to ask the question. I found out by accdident while reading an article about the various advantages of different pedal styles – not research, just a link I happened to click on in /r/bicycling.

So what are the things that everyone knows?

When I tried to teach my mom how to use iPhoto, giving her instructions via Facebook chat, I didn’t understand why it took her so long to follow my instructions. It turns out that she thought you had to close the web browser to get it off the screen, then open iPhoto, then do the thing, then close iPhoto, then reopen the browser…etc. My mind was sblown when I saw her doing it in person. This isn’t an “Old people do dumb things” problem, though. I come up to it all the time, and my OWN stupidity catches me by surprise quite often. Staring at a Java if statement for several hours:

before realizing that it should be:

I’ve been trying to get the CakePHP framework running on my computer, without much success. The docs contain this sentence:

“For some reason or another, you might have obtained a copy of CakePHP without the needed .htaccess files. This sometimes happens because some operating systems treat files that start with ‘.’ as hidden, and don’t copy them.”

This was exactly the problem I was having, but the doc didn’t tell me what do about it. I found the answer from some other obscure blog, after dozens of Google queries. The Cake doc, though clear, easy to read, and fairly complete, seemed to assume that I would know what to do if these files didn’t turn up.

Am I an idiot? Well, yes, obviously. But we’re all idiots when we’re doing something new. Too many instruction manuals skip vast swaths of information, because they assume you already know how to do the things they’re telling you to do. And these bits of info are so hard to track down, because you don’t know what question to ask. Ever tried starting a standard transmission car, and it just wouldn’t?

The first question to ask, is “Did you push the clutch in?”. But I made that mistake tons of times when I was learning to drive, and people would offer me booster cables and jerry cans. They assumed…   and that’s the problem.

Don’t assume someone knows something just because they’ve made it to the age of 23, or 63, or whatever, without dying of idiocy. When you encounter a person being dumb, think of the last blindlingly dumb thing you did (if you can’t think of any, you aren’t paying enough attention), have sympathy, and just fill in the missing information without judgement or ridicule. It’s classier, and hopefully they’ll return the favor.

Would you like to receive updates by email?

Confess

I have to confess.

I’m too lazy. I should be working on finding a co-op position for the summer. Last year, my cousin was in the same position, and he didn’t find one. He left it till too late. I sneered at him behind his back.

Earlier in the year, last quarter, I was fired up and raring to go. I started doing research over Christmas break. I had sent out 7 resumes by mid-February. I was far ahead of my classmates. I got positive replies from several employers, and an interview from one. The interview yielded a job.

That job must have really burned me out, because I haven’t sent out another resume since then. The indifference of man who hired me, his lack of communication with me, the disinterest of the other employees in my department (they didn’t even introduce themselves, after 2 months), and finally, their failure to deliver my final pay check left me angry and disillusioned with a company that I had admired.

Far from daydreams about high paying jobs with prestigious companies, like I was, I now consider whether I should go back to my old job washing cars this summer, or maybe shoot a bit higher and try to get a job assembling bikes.

What brings me joy these days:

I still love writing code. As aggravating as it is, as lost as I feel, when I finally get something to work the rush is incredible. I love it when I know what I’m doing, fall into a groove and sit there banging out code for hours. Or when a problem gets stuck in my head, so I think about it in the shower in the morning, on the bus to school, during the lectures, and finally solve it in the lab after several hours of wrangling. The green bar in a JUnit test is probably my favourite thing in the entire world right now.

Programming is my passion. But am I good enough? When build something on my own I don’t have much success. One job I applied to involved a lot of PHP. It’s a company called Radar Hill. I really want to work there, it sounds brilliant. I like PHP too, despite the constant house-of-cards feeling I get when I code in it. But they use the Cake framework, which they say is easy to use. Well, I’ve been trying, off and on for months, to get the stupid thing running on my computer. Can’t. I’ve tried half a dozen times, made some progress, but have not yet even gotten to the point where I can actually write and install code. I’m still trying to figure out why the .htaccess files don’t work.

The internet says that the CakePHP documentation is pretty bad, which fires up in me the desire I feel every time I encounter incomplete docs, to fix them and make them right.  I could be a technical writer pretty happily.

I can chuck it and build wheels instead. I love building bicycle wheels. I may regret the lost time for awhile, but I always bounce back to happy. Instead, I’ll slog through, gasp with joy every time I see that green bar, try to motivate to build something, try to will myself to look for a job.

I don’t feel hopeful. Only bloody minded determination.

 

Would you like to receive updates by email?