Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on May 30, 2013
  1. Pagination and map/reduce count fix

    Enabled pagination on the web UI so that a user can see the full list of snippets that they have submitted in chunks of 10. They are ordered by the date they were submitted using the presort feature of Riak Search.
    Fixed up an issue in the map/reduce counter for vote counts which was causing things to crash. Stupid mistake really!
  2. Use binaries for strings and Jiffy JSON

    In my ignorance I was using strings all over the shop when I should have instead been using binaries. This commit fixes this and all the "string" value use binaries.
    mochijson2 has been stripped out and instead we're now using Jiffy, as it's a bit faster (NIF) and I like the syntax a bit more. Encoding of atoms is completely gone now, all elements in the JSON are just binaries. As a result, csd_json has been ditched.
  3. Pass the page/page count to the UI

  4. Remove field data from snippet store

    The store doesn't know about the fields in the data, and it shouldn't. So that logic is back where it belongs.
Commits on May 29, 2013
  1. Use search to load snippets with paging

    Instead of M/R we are now using Riak Search to pull snippets out. This returns the values in chronological order instead of reverse chron.
    We have the data we need to deal with paging, but the UI doesn't yet support paging as we aren't doing anything with the result.
    Also fixed up a small issue with the webmachine logger while I was at it given that we're now using the latest version of WM.
  2. Include Flake for ID generation

    The way we were generating IDs was terrible and caused issues. We're now using Flake to generate IDs so that we know we get good IDs that won't collide across nodes and that will not result in characters in the ID which cause problems in URLs.
  3. Update vote count M/R to use Erlang

    JS Map/reduce jobs are a fail. This commit includes changes which allows for the map/reduce for vote counts to be conducted using deployed erlang modules. The commit includes a makefile change to allow for the modules to be compiled and loaded into Riak. This commit is specific to my environment, but so is everything else so why not!
    Modules are stored in the `apps/csd_core/riak_modules` folder to keep them separate from the application's source.
    Two different types of map reduce are removed and one added. The counting of values when the user is logged in is combined into the same query as when the user is not logged in.
Commits on Jan 6, 2013
  1. First stage of comment support

Commits on Aug 30, 2012
  1. Fix index look up with Riak 1.2

    It appears that functionality of indexes in Riak 1.2
    is a little different to earlier versions this change
    accommodates those changes.
    Thanks to Naoya Yamamoto for picking this up!
Commits on Jul 9, 2012
  1. Renamed static file handler

Commits on Jul 8, 2012
  1. Fix the logout functionality

    * The logout button was available but didn't do anything so this
      commit fixes that and actually makes it work in a semi-sensible
      manner. This will need work down the track.
Commits on Jul 2, 2012
  1. Remove nginx from Makefile

  2. Vote fix, nginx removal, static file resource

    * Fixed up the inconsistency in the way the "Which" value in
      the vote map/reduce job was coming back.
    * Removed the nginx config and went back to a functioning
      haproxy config. Removing a moving part is a good iea.
    * Added the csd_static_resource to handle the static files.
      For the sake of this application this is more than enough, it
      will be noted that production use wouldn't rely on this resource.
    * Added routes to point the static file URIs to the appropriate
      folders on the file system.
Commits on Jun 5, 2012
Commits on May 7, 2012
  1. User name rendering, user/snippet API tidying

    * User names are now rendered when you view a profile page that
      isn't your own (if it's your own then you just see "Your").
    * Tidied up the APIs for snippets and users as some functions
      weren't used or some overloads could be removed.
    * Removed the timeout from the nginx config which seemed to be
      having the opposite effect.
Commits on May 5, 2012
  1. Code cleaning and M/R refactor

    * Map reduce is now in its own module just so that the general
      API of riak usage isn't overly polluted with map/reduce stuff.
    * Cleaned up code, removed io:format calls, added comments and
      made the source feel a little more consistent formatting-wise.
Commits on May 3, 2012
  1. More code tidying

    * Added comments/sections/etc. General tidying.
  2. Tidying up of DB code

    * csd_core_server wasn't necessary because it wasn't retaining any
      state. As a result it was removed.
    * csd_db was added as a replacement to csd_core_server. This was put
      in place to abstract riak a little from the caller and to hide the
      detail of using the pooler module.
    * All the entity modules (csd_user, csd_snippet, csd_vote) now use
      the new csd_db module.
    * csd_core_sup wasn't needed now that csd_core_server is gone.
    * Application startup is now simplified and just has the job of making
      sure that the pooler has started.
  3. Various adjustments prior to posting

    * Used 'offsetX' classes in the UI for padding.
    * Added comments to the csd_riak module.
    * Removed vote_* fields from snippet.
    * General code tidying.
Commits on May 1, 2012
  1. UI Polish, end to end submissions and voting

    * Users who aren't signed in can't vote.
    * Signed in users can vote, vote detail is written to Riak.
    * Vote queries now come out of Riak thanks to 2i and map/red.
    * Sorting of submissions on the user page now works.
    TODO: just a little bit of polishing of code, commenting things
    and tidying up bits here and there. Then it's time to start work
    on the blog post which describes all the changes... there are a
Commits on Apr 29, 2012
  1. Updated snippet interaction, UI tweaks

    * Broke up the snippet view into a few other views.
    * Made the UI animate when the snippet is shown.
    * UI animates again when the vote is cast.
    * Made sure colours were adjusted as well.
    * Commented out some functionality thats not yet implemented in the back end
      and added some randomness to the front end to make it look like things
      were happening.
    * Also commented out the bits which hide the vote buttons, this will obviously
      go back in down the track when the server-side is done.
    Need to implement server-side tracking of votes.
    Need to store the UserID and Name in a user bucket in Riak.
    Need to stop multiple votes from the same user (both client and server).
Commits on Apr 28, 2012
  1. UI updates, voting buttons/bars, nginx change

    * Snippet view has voting buttons, graphs and a vote count.
    * Green means the snippet is winning, red is losing. Blue will be
    * Removed the DTL views that aren't going to be used any more.
    * Nginx config tweaks.
    * Document title now changes with the view that is rendered.
  2. Syn highlights, build image, more UI fixes

    * Travis CI build status is now in the readme.
    * New snippet and snippet view has had an overhaul, and now looks
    * A few minor bug fixes.
    Still need to get this damned sorting working. Also need to fix
    up the ID generation of the snippets, as it's not that great.
  3. New views, bootstrap and date formatting

    * Now rendering the site with Twitter bootstrap. Looks better.
    * Updated the ref to oauth so hopefully now the build will work
      on travis CI.
    * Lots more work on the front end to make it look tidy.
  4. More end-to-end functionality, new proxy and UI

    * Back end now stores and retrieves snippets for the logged
      in user.
    * Snippets are stored with the user login ID (from Twitter) used
      as a 2i for looking up the values.
    * Snippets for a user can be listed.
    * New front end, driven by Backbone, now allows listing and submission
      of snippets.
    * csd_riak contains more functionailty for dealing with mapreduce
      and for dealing with indexes.
    * csd_snippet had some functionality pused into csd_snippet_store
      so that concerns could be separated.
    * csd_snippet is what invokes calls to the csd_core_server, so that
      is now kept from the caller who doesn't need to know it is there.
    More work required on the UI, but we're getting there.
Commits on Feb 17, 2012
  1. Fixed config

Commits on Feb 15, 2012
  1. Final couple of tweaks for part 4

Commits on Feb 14, 2012
  1. Bits of refactoring

Commits on Feb 12, 2012
  1. Implemented the first pass of Twitter OAuth

    * Fixed up configuration via config module.
    * Implemented the oauth resources.
    * Added dep to erlang-oauth (rebar friendly).
    * Moved webmachine config and adjusted code to load it from new
    * Put template rendering into a view module.
    * Adjusted Makefile with new config params.
    * Started adding the DTL hierarchy.
    * Added Twitter API functionality.
    * Added a home view which renders differently depending on if
      you are logged in or not.
    * Added checks to make sure user isn't already logged in, added
      support for storing login information into cookie.
    Next up: Storing session-based data in Riak.
Something went wrong with that request. Please try again.