Zach Latta

Founder of hackEDU. Maker of things.

Read this first

Scribe

This past weekend I went to PennApps with three of my good friends. Over the course of the weekend we made Scribe, an iOS application that turns drawings or sketches into functional websites. It consists of an Objective-C iOS frontend and a C++ and Python backend. It was our first time working with OpenCV and was an incredible learning experience.

We’d like to make the application public, but are still ironing out kinks in the backend. In the meantime, you can watch our video demo below.

View →


AngularJS and Yeoman with the HTML5 History API

By default the Angular Generator for Yeoman isn’t set up for the HTML5 History API. Enabling it will make our routes look like https://example.com/register instead of https://example.com/!/register.

We can enable it by putting the following snippet of code in the .config. section of app.js.

if (window.history && window.history.pushState) {
  $locationProvider.html5Mode(true);
}

We’ll also need to inject the $locationProvider service, so make sure your .config function accepts $locationProvider as an argument.

Here’s what the default app.js looks like after these changes.

'use strict';

angular.module('app', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngRoute',
])
  .config(function ($routeProvider, $locationProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/main.html',
        controller: 'MainCtrl'
      })
      .otherwise({
        redirectTo:
...

Continue reading →