A Quickie on Using Android Studio on Ubuntu

Filed under: Coding — Tags: , , , — Darryl Clarke @ 7:01 pm

The original post below applies to old versions. For 0.4.x plus, you don’t need to do this. You just need to have a proper Oracle JRE/JDK installed system wide which you can do with this:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-jdk7-installer

With the recent preview release of Android Studio it’s important to know that it won’t work properly on Ubuntu with the OpenJDK that’s available.

Fortunately, it’s easy to get it going.

  1. Download the official Oracle JDK
  2. Unpack it (I put mine in ~/SDK/jdk1.7.0_21/ )
  3. Point your JAVA_HOME to this.
    ~/android-studio/bin$ export JAVA_HOME=~/SDK/jdk1.7.0_21/
  4. Run the android studio startup script.
    ~/android-studio/bin$ ./studio.sh
  5. Make awesome android apps.

Have Fun!

Allowing the Facebook Debugger through nginx’s auth_basic

Filed under: Security — Tags: , , , — Darryl Clarke @ 10:15 am

In my prior post, Allowing the Facebook Debugger through .htaccess, I showed how you could do just that. But, as time goes on, I spend more and more time with nginx and I need to adapt my rules.

So, today, I decided I should do the exact same thing with nginx. All of the dev sites I work on are generally password protected with a standard auth_basic setup. This is great, keeps the robots out and prying eyes away. But it’s always an issue when you need to test sharing and other external scrapers.  As it turns out, doing so with nginx is just as simple as it was with Apache.

My initial ‘location’ block was a simple configuration:

location  /  {
  auth_basic            "Restricted";
  auth_basic_user_file  htpasswd;

  if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php last;
  }
}

To allow Facebook debugger through the simple auth_basic was as easy as adding an if check and a secondary ‘location’ rule.

location  /  {
  error_page 418 = @allowed;

 if ($http_user_agent ~* facebookexternalhit) {
         # bypass httpauth.
        return 418;
  }
  auth_basic            "Restricted";
  auth_basic_user_file  htpasswd;

  if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php last;
  }
}

location @allowed {
if (!-e $request_filename) {
              rewrite ^(.+)$ /index.php last;
 }
}

The first thing added was a rule for nginx to understand what I mean when I say ‘return 418’ – this is the http response code for “I’m a teapot” The if block simply checks if it’s a known facebook agent, and the third block is a custom location that strips out the authentication requirements.

It’s generally fairly simple the concept and can be applied to any other external scrapers that you may need.

Allowing the Facebook Debugger Through .htaccess

Filed under: Coding — Tags: , , — Darryl Clarke @ 3:24 pm

Here’s a short story; When I develop Facebook web apps, I do it under a password protected development site. Facebook hates this. It complains that it can’t reach urls, it can’t get meta data, it can’t do this, it can’t do that. The downside to not having a password is the fact that anybody can hit the site. (sandboxing is almost useless, these days.)

So, the quick solution: Allow Facebook to hit it, but only via their external meta data scraper.

A quick edit (well, not so quick, it was something obscure.) of my .htaccess rules, and voila! Facebook can debug and people still can’t hit it (easily)

SetEnvIf User-Agent ^facebookexternalhit.*$ Facebook=1

AuthType Basic
AuthName "Art & Science DEV Server"
AuthUserFile /home/dclarke/www/dev/.htpasswd
Require valid-user

order allow,deny
Allow from env=Facebook
Satisfy Any

First, set an environment variable based on if it is the Facebook user agent. Then, allow access. The key here is the ‘satisfy any’ line, which means you can get in if you have a user and password, or that environment flag is set. The downside is now you all know you can just set your user agent to Facebook and get access to my dev sites. 😉

Experiment: The Viewport Viewer

Filed under: Coding — Tags: , , , — Darryl Clarke @ 3:12 pm

As a little experiment, while I redesign my own site, I decided to create a ‘Viewport Viewer

It’s a little tool that’ll load up a site in an iframe and let you re-size the iframe to some specifics, like an iPhone, or iPad in portrait mode. Go play with it and see.

It’s pretty straight forward: enter your URL, then toggle between sizes as you see fit. If your site is responsive it should fit in the iframe with out any issues.

It’s by no means meant to replace actual hardware testing with your sites, but it is quite handy during the initial phases of your responsive web development.

There are some downsides to it, however. One that I can think of is that it does not utilize ‘min-device-width‘ or ‘max-device-width‘, or any other ‘device‘ related queries. Because, well, it’s all in a browser and not on a device.

Anyway, there’s the tool, hopefully it’s of some use to you. If not, oh well. It’s been useful to me.

There’s Something about FITC Toronto…

Filed under: Conferences — Tags: , , , , , , — Darryl Clarke @ 8:41 pm

On the days of April 23rd to April 25th, 2012, I attended a few various sessions at FITC Toronto. At the time the amount of information I was consuming was a little bit of overload. However, now that things have sunk in, I’d like to reflect upon it.

HTML5 Gaming

One of my primary goals of the conference was to cozy up to the idea of HTML5 gaming. It’s definitely a big thing that you can’t ignore.  The concept of being able to write a game and deploy it wherever an HTML5 capable browser exists is somewhat exciting.

First up on my list was “HTML5: My Life in the Trenches” with Grant Skinner. For the most part Grant introduced the audience to a nifty set of tools called CreateJS – which I think has great potential to become a solid standard for HTML5 gaming libraries. As you can see from some of the featured demos on the CreateJS site, developers are already building a great array of types of games. They’re fast, well done, and with the tools used they maintain compatibility across platforms that support HTML5.

Next up was “My Adventures in HTML5 Gaming” with Jesse Freeman. Jesse’s focus was more oriented towards the design of games and making what you want. When it comes to actually designing, you shouldn’t be afraid to share your ideas with others. You should document every little feature you want, even if it’s not realistic at the time. Also, don’t be afraid to just re-create something you like. It’s one of the best ways to learn. Jesse’s primary HTML5 library of choice is ImpactJS (he’s also selling a book about it), a full featured canvas and game engine. It’s $99, one time, per developer license fee might keep people away from it.

In both presentations it was made clear to me, albeit indirectly, that Adobe’s direction is definitely moving away from Flash as a final distribution format.  They’re re-tooling and adding the ability to export Flash and related assets directly into HTML5 libraries and resources.  These resources can be easily leveraged by any awesome HTML5/JavaScript library.

Overall, both HTML5 related talks were pretty good.  They definitely opened my eyes to newer tools and technologies with some innovative ways to use them.

Aware, Phsyical, Wearable, and Interactive Things

Another one of my favourite things of late is the ability to have things that are aware. Whether it’s my phone being aware that I’m in the office or at home; or my couch aware that I’m sitting on it; or the ability for my computer to detect that I turned on my Apple TV and ask me “Hey, Darryl, do you want me to turn your TV to Input5?” where I say yes and it does it.  But I digress. These potential things are just too awesome.

There were a few presentations that I saw that I felt were right up this alley. “NFC: Thinking Creatively Beyond Mobile Payments” with Pearl Chen was one such eye opener. The idea of using NFC to tag food storage containers and connect it to recipes in Evernote was one such awesomeness.  Another being a ‘smart’ case for your phone, which can detect via NFC the orientation of your device and set it’s ring tone to a certain way. It’s pretty damn cool.

Hey Ellie, What are You?” with Matt Fisher was a pretty awesome display of how you can leverage open source projects to create your own. With his home brew always-on voice command recognition system a la HAL or Jarvis (Iron Man), the potential for home automation and home awesomeness is endless. This one presentation alone filled my melon with so many ideas. My Evernote cupeth floweth over.

A Window to the Physical” with Peter Nitsch was all about going beyond digital, on screen, glass interfaces. His talk ventured into the realm of “the internet of things”, a world of connected and aware devices. He touched on a lot of greatness like how affordable and accessible DIY physical hardware (arduino, 3d printing, prototyping) has become.  And literally, if you can think of something, you can likely make a prototype these days without much cost.  The concepts presented really work into my overall desire to make something using things that are aware and things that can interact with other things.

The most interactive presentation was Marvin.  Marvin was just hanging out in the lobby for the entire time. He wasn’t really presenting anything.  I don’t think a lot of people realized what Marvin was.  A giant bear-like creature that for the most part just had people sitting on it.  Until people realized the sign that said “Run and Jump on Marvin…” Then the fun began.  As it turns out, Marvin was loaded up with some sensors and he detected a good pounce and hug.  When that happened, the bigger the pounce the bigger the “smile-works” show was above him.  You can see the videos below. It’s silly little cool things like this that make me love technology.

Experimentation

When it all comes down to putting all these incredible technological things together it takes time and process. And that’s where a talk titled “The rapid prototyping, creative incubating, lean startup.” by Hoss Gifford comes in to play.  He explained a lot about process that they use at OneMethod.  Everything starts with an idea and gets a time limit. A two month incubation time limit. If you cannot take your idea to a working prototype in that time, it should likely be back-burnered.  The main reasoning is that everyone’s passion around a project is at a high during the early stages and as time goes on that high can fall down drastically, so they jump on another new project with a fresh new high.  Not to say all projects should be thrown out; but the amount of attention you should give it is directly related the initial feedback and response of your prototype.

The prototype itself should be as lean as you can make it.  The most minimal, working product you can get to market that does what you want.  Time to market is typically critical. In this digital age if you sit on your idea and “make it perfect” over many months or even years, chances are the technology you’ve built it on, or the social buzz that you were banking on has likely moved on.

Overall, I found most of the sessions at FITC Toronto 2012 to be very well rounded. There were many other sessions that I attended with mixed impressions and little take-away. These ones though, they really hit home. Together, each of the sessions I have mentioned will all play a little (or big?) part in how I operate my future initiatives.  I’ve got a lot of crazy ideas. I can see the process.  Now if only I can find the time.

And Finally, Some Useless Content 😉

It’s So Meta

Filed under: Randomness — Darryl Clarke @ 12:03 pm

It’s time for yet another meta post.

I’ve redesigned my blog. It’s here, it’s new. It’s tidy. It’s the first phase of change that you may or may not notice.

As it stands right now, I’ve not even looked at it in IE, so I doubt it works. But it’s got some awesome IE Chrome Frame pusher, so hopefully I never have to deal with IE again. Now that that’s done, here’s what it is…

  • HTML5
  • CSS3
  • See Humans.txt (in the footer) for more.

I’ve also simplified a lot of the WordPress feature overkill that existed. I’ve killed comments, pingbacks, and most user interaction because it’s mostly spam. If you want to say something to me, tweet it, Facebook it, Google Plus it.

I’ve gotten rid of most of the clutter that comes with sidebars and widgets and idiotic things that mean nothing. You know, all that shit that nobody ever uses. I’ll, in the future, keep any experimental items to their own pages.

Some old posts might look like ass. Let me know and I’ll go back and fix ’em. But the handful I’ve looked at look pretty swell.

That is all.

See you on the Twitternets.

Older Posts »