Home

Stripe Credit Card Processing : Thoughts?

If you don’t know, now you know:

https://stripe.com/

Stripe is, or rather states, that they do online processing for a flat fee and act as your gateway interfacing directly with your bank. AWESOME! I think Stripe is pretty new right now; and unfortunately I haven’t used them to know how great it really is. But, I’ve built enough online stores to know that online transactions are cumbersome. You can push for one gateway over the other but ultimately you’re going to deal with several over the course of your career.

PAYPAL!?

Ever tried using PayPal to accept money? Of course you have. Have you ever tried to build a store around PayPal? No, you haven’t. Because if you have then you’ve surely jumped off a cliff by now. I can’t seem to test in the developer sandbox of PayPal’s without having their service go down at least twice. Now the live gateway is reliable, but testing is a nightmare!

OTHER GATEWAYS

So there are a ton of other gateways. And I’ve used several in combination with dozens of merchants. I definitely favor some over others. And, I’m not trying to knock any one of them or say what anyone should or shouldn’t use. But, I do want to hear from people out there.

Have you used Stripe? If so, how was/is it. How good is it for larger scale store type systems? How do you handle refunds, escrow, or customer data? If you haven’t used Stripe do you think you would? I’m going to give it a try next chance I get. The fees are right and I’m excited for a service like this to be available and I think it’s a long time coming. Kudos.

 

AIR3 In Flash CS5 For iOS / Android

Still slacking. But I just thought about this blog and thought I would put up my recent troubles.

Adobe has been touting lately that the new version of AIR is so powerful that people are porting over intense Flash games for iOS. Being an avid AS3 developer I didn’t want to miss out on testing AIR for iOS and Android both. We’ve been able to do development for both these platforms for nearly 2 years now so I’m not going to tell you anything revolutionary or cutting edge. Instead, I’m going to help out the few, or more likely many who just haven’t come forward, who want to develop iOS apps in the latest version of AIR (currently 3) but are using the Flash IDE. There’s a few resources out there for Flash/Flex Builder and CS5.5 but not a lot pertaining to how to get your old run-down AS3 projects built in Flash CS5 into AIR3.

I’m doing the leg-work, but the harder stuff was figured out for me.

http://blog.prevail.co.nz/2011/06/21/overlaying-air2-7-in-flash-cs5/

Over at the prevail blog (and I don’t really know who or what prevail is) I found a great article some time ago about getting AIR 2.7 to compile in CS5. That’s super because CS5 only gives you AIR2 capabilities and little documentation exists anymore as to how to update it to something better.

But wait!? I said AIR3 not 2.7

True, and part of why I’m writing this is because currently the last post on that link above asks if anyone has got AIR3 to work yet. I responded, and have yet to be approved! So I’m telling it here in a little more length. If you follow the precise steps laid out in the blog above you can upgrade CS5 to 2.7. And, you must do that before updating to 3. Once the steps have been taken to update to 2.7, and you’ve compiled an app to 2.7 successfully, then you need to go to the adobe site: http://kb2.adobe.com/cps/908/cpsid_90810.html and follow the instructions for updating Adobe CS5.5 to AIR3. Now, obviously we’re updating CS5, not 5.5. But, if you just pretend the everywhere on the Adobe site that CS5.5 reads CS5 then you’ll get AIR3 updated successfully and be able to compile from the Flash CS5 IDE.

UPDATES

So I know that things change and pages update. In fact, the only reason I bothered figuring out how to get AIR3 installed was because I was having trouble getting 2.6 installed to run an older project after formatting my computer and thought, “why not just go all the way to 3?” So if Adobe has jacked the link above, or updated AIR once more, then here are the steps below:

  1. Download the latest AIR3 SDK (http://www.adobe.com/products/air/sdk/).
  2. Archives of the AIR SDK’s are here if 3 is no longer the current version: http://kb2.adobe.com/cps/853/cpsid_85304.html
  1. Close Flash Professional CS5.
  2. Browse to either of the following to locate the AIR2.6 folder:
  • C:\Program Files\Adobe\Adobe Flash CS5\ (Win)
  • Applications/Adobe Flash CS5/ (Mac)
  1. Change the AIR2.6 folder name to AIR2.6OLD or delete it if you don’t want to save a copy of it.
  2. Rename the unzipped folder (SDK folder) to AIR2.6.
  3. Place the folder in either of the following locations:
  • C:\Program Files\Adobe\Adobe Flash CS5\ (Win)
  • Applications/Adobe Flash CS5/ (Mac)
  1. Browse to the AIR2.6/frameworks/libs/air/ folder in the Adobe Flash CS5 folder and copy airglobal.swc.
  2. Paste the SWC file in Adobe Flash CS5/Common/Configuration/ActionScript 3.0/AIR2.6/ to overwrite the existing airglobal.swc file.
  3. Open AdobeAIR2_6.xml, AiriPhone.xml, or Android.xml inside Adobe Flash CS5.5/Common/Configuration/Players/ using any text editor.
  4. Change the version attribute of the player tag from 11 to 13 and save the file. Make sure that it looks as follows for the relevant file:
    Android.xml<player id="android_0" version="13" asversion="3" minasversion="3">AiriPhone.xml<player id="PFI1_0" version="13" asversion="3" minasversion="3">AdobeAIR2_6.xml<player id="AdobeAIR2_6" version="13" asversion="3" minasversion="3">

The above steps were pulled from Adobe directly and modified by me to read CS5 instead of CS5.5 and I removed a couple of nonsensical steps that adobe had at the end that didn’t need to be done if we followed the steps from the prevail blog. Now let’s just how prevail doesn’t change their post!

Chop A String On a Whole Word With PHP

I’ve been slacking an not writing anything so I’m going to start trying to write much smaller posts starting with this one. A common need for template developers is chopping a string at a whole word. There’s a lot of functions out there on the web to tackle this problem and I went searching for one quickly today rather than just writing one. What I found was a bunch of functions that either a) didn’t work or b) didn’t work well enough. So most of the time you want to chop a string down to 35 characters or so right? For instance, you want to display a post title but you want it to display only on one line but some of the titles are going to break that line.

This function breaks a string on a whole word and makes sure that the string doesn’t go over the set amount of characters you set. This means you always get a string that fits where you want it to; ALWAYS.

function neat_trim($str, $n, $delim='…') {
  $len = strlen($str);
   if ($len > $n) {
       	preg_match('/(.{'.$n.'}).*?\b/', $str, $matches);
		if(strlen( trim( $matches[0] ) ) > $n)
			return substr( $matches[0],0, strrpos( trim( $matches[0] )," ") ) . $delim;
		else
			return $matches[0] . $delim;
   }else {
       return $str;
   }
}

It’s pretty straightforward I hope. You pass the string, the maximum characters your string can be, and a delimiter to display at the end of the string if you chop it. By default it displays … but if you don’t want anything just pass an empty string. I didn’t do all this myself (not that there’s much there). This is based off a broken example I found on the web. The word boundary in the regular expression was mis-used in the example I found so I fixed it, then made it so that the string never goes over n characters. The original would chop it at the next whole word it found which meant our string could be anywhere between n characters and n*E-10. You get the picture. I’m not a math wizard so that’s probably wrong ha ha. I mean what if you wanted to catch 30 characters on one line and the string you chopped was:

“this is my string of existentialism”

My function returns “this is my string of…” whereas most return “this is my string of existentialism” which can completely ruin a layout. Anyway, no need to beat this dead horse back to life. I hope this helps people. If you have a better, cooler, faster, shorter (or longer) way of doing this post it in the comments!

Sending Emails That Don’t Suck With WordPress

I’ve wondered about emailing in WordPress for a while but never did anything about it. How does WordPress send emails? What functions can we hook to for emails? What if I want to setup a template with a form and email someone? And, what if I want to send nice html emails and not just plain-text formatted ones? These are all good questions and definitely what I have been wondering. Let me start out by answering the first question. WordPress doesn’t do anything fancy for sending emails. Nope, no SMTP connections, no html headers, nothing. WordPress just uses the mail function like any PHP application would and sends a regular old plain-text email. Well that’s cool for WordPress, but sometimes that sucks!

Read More

Understanding Variable Scope

This week I saw a lot of problems on forums, and at our office related to scope. So I’ve decided to write on scope as it relates to a few languages and discuss why understanding variable scope can save you a lot of headache. I know there are already quite a few articles online about it; but while most only discuss how to keep variables in scope and use them, most don’t talk about the importance of it. And, more importantly, I don’t see a lot of articles discussing scope as it relates to variable declaration and in some cases datatyping. Let’s get right to it.

Read More

New jQuery Content Rotator Plugin

This is an official release of a jQuery plugin I wrote some time ago and have been using and updating a lot lately. I’ve decided to release it here, and on jQuery, because I’ve finally got all of the bugs out and it has enough options and methods to work for any job. As devlopers we get a lot of requests for some image slideshow or content slideshow at the top of the homepage or some subsequent page. I’ve browsed jQuery’s image rotator options a dozen times and had a really hard time finding something that just worked. Lots of authors out there are creating plugins that are styled one way by default, come with too many requirements for the layout, or that just break; and so I’m throwing my hat into the ring. This plugin creates an image (or content) slideshow based on any nested element.

Read More

Editor Of Choice

I’m a pretty big fan of open source initiatives, code, rules, and especially software. If you go to school for computer science they’re going to give you the command line and probably a bunch of proprietary software; either free or not, to develop with. Sun puts out a decent developer JAVA. Microsoft has Visual Studio. And, if you’re as fortunate as me you’ll get to learn BASIC and you might even come upon a floppy with QBasic on it! If you’re doing web development you may even be told to use Dreamweaver to do your HTML and CSS (if they’re even aware of CSS). While I’m a big fan of JAVA and of Visual Studio as far as ASPX is concerned I’ve got to tell you I don’t use either often. And, I don’t do ASP development ever and don’t plan on it. Not because it’s Microsoft but because there is enough stuff out there to learn about and that system isn’t one that’s I’ve been around or care to use.

Read More

Password Protecting HTML Files

The other day I was doing some work on a back-end system for a client and ran into the problem of having a ton of html files that needed to be accessible only by administrators. Why would I have a bunch of html files you ask? For practical reasons you may have any number of files you don’t want displayed on the web to just anyone. I happened to have a large library of code documented with ASDoc. Anyone who has used, or is interested in using ASDoc knows it creates a large number of html files. My particular project has been one spanning several years and consists of thousands of lines of code and a hundred or more classes across dozens of packages. But, that’s sort of irrelevant. What is important is that I had a hundred or so html files I suddenly needed to protect online.

Read More

Mobile Framework Roundup

I’ve been working at this office in Bakersfield for about 2 years now after my foray into the freelance world which I did also for 2 years. And while I still freelance on the side it’s nice to work with a team of people I see everyday. It also provides me the opportunity to start taking more time out and writing about the work I do and things I love. Recently at the office I built our towns first mobile app. It is geared primarily for the iPhone although I’ve heard rumor it runs pretty well on Android as well. In building this mobile app I ran into a lot of hardships and created quite a few workarounds to problems that may have been easier to fix than I made them. However, it was a learning process as it was my first mobile app and it turned out to be a pretty awesome one at that!

IN THE BEGINNING

Let me start by listing the frameworks I tried:

jQuery Mobile
jQTouch
Sencha Touch

Read More

AS3 Remoting Class & AMFPHP

So if you haven’t heard; AMFPHP has been a big deal. With Flex doing all of Flash’s heavy data lifting lately it’s been a real, crying, egregious shame that Adobe has left out the Remoting Components from AS2. Although, I’m not going to just sit here and ramble on about how Flash is still more than capable of remoting and how tons of people are still doing it. Instead, I’d like to offer first my solution, and second a list of places that helped me get there. This blog and access to my classes has recently stemmed from a conversation (email) I had with Josh Strike and his strike remoting class. I’ll admit I haven’t looked it all over or even used his class; but below I’ll offer my version which unknowingly to me grew out of his; or shrank I should say.

If you’re antsy, here’s the classes in all their glory: RemotingService

Read More