GithubHelp home page GithubHelp logo

isabella232 / riak_function_contrib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trifork/riak_function_contrib

0.0 0.0 0.0 221 KB

Riak Function Contrib

Home Page: http://contrib.basho.com/

JavaScript 29.47% Ruby 7.64% Erlang 62.89%

riak_function_contrib's Introduction

Riak Function Contrib

Riak Function Contrib is a community-powered library of MapReduce, Pre-/Post-Commit Hook, and other functions. It exists for several reasons:

  1. So Riak users can contribute functions they've written back to the community in one centralized, easy-to-manage location
  2. To provide users who are new to Riak with a list of previously-created and tested functions that may suit their usage needs
  3. To lower the barrier to entry to using and mastering MapReduce and Pre-/Post-Commit Hook Functions in Riak

Usage

To use the code in this repo you can either browse the source files of the functions in the directory of your choice or head over to the Riak Function Contrib site to search for useful code and read in depth descriptions provided by function authors.

Issues or Questions

If, at any point, you have a question or issue, email [email protected] or join the Riak Mailing List and submit your question there.

Contributing

Have a function to share with the rest of the Riak Community? Great. Here is how you do it:

  1. Fork this repo to your own GitHub account (You can read up on forking here if you need a refresher)
  2. Add your function source file to the appropriate repo (explained in depth below)
  3. Add your overview file to the appropriate repo (again, explained below)
  4. Send a pull request
  5. Kick back, smile, and relish in the fact that your functions are helping Riak users everywhere

Your Function Source File

Step 2 above is "Add your function source file to the appropriate repo." The MapReduce Functions live in the mapreduce repo, and are broken up by languages (Erlang or JavaScript). Pre- and Post- Commit source code lives in the hooks directory and is broken down by type (Pre and Post). For instance, if you have a JavaScript MapReduce Function to contribute, it will live in this directory.

What should the source file contain?

  1. Apache 2.0 License Boilerplate. All files submitted to the Riak Function Contrib Repo must include the Apache 2.0 boilerplate. If you're unfamiliar with the Apache license and how to include it in your code, please take a moment and read up on it here.

  2. Your code. This is fairly self-explanatory. In addition to the code, make sure to include adequate comments and notation. Here's a great example.

Your Overview File

In addition to your source, you're encourage to take a few minutes and put together an overview file. Why? Because your contribution to Riak Function Contrib will visible in two locations: 1) as part of the actual code repo in the form of your source file and 2) as an overview page on the Riak Function Contrib site For example, the overview page for this function lives here

This is actually pretty simple. We use Gollum to generate this site. What that means is that your overview file can be written in either Markdown or [Textile](http://en.wikipedia.org/wiki/Textile_(markup_language). Gollum will take care of converting them to html and, once you've sent the pull request, we'll regenerate the site and make sure your contribution goes live.

And, since we are using Gollum, you can build the site locally to make sure everything looks right before you send your pull request. Specifically, here's what you need to do:

  1. Install Gollum
  2. Install Gollum Site (This is a simple static site generator for Gollum written by Basho's very own Dan Reverri)
  3. cd into your local copy of the Riak Function Contrib repo
  4. $ gollum-site generate && gollum-site serve
  5. Head to http://localhost:8000/

This should get the site running locally and you should be able to view your additions. You must commit your changes locally in order for Gollum to generate them

A General Note on File Naming

Try to name your source file in such a way that it describes what the function might be used for. For example, if the code is a JavaScript reduce function that is good for filtering out large objects, you might name it "large-object-filter-reduce.js"

Also, be sure to name your overview file with the same name as your source file (save for the extension, of course). So, to continue with the example given above, if your source file is named "large-object-filter-reduce.js" you would name your overview file "large-object-filter-reduce.textile"

Other Resources

riak_function_contrib's People

Contributors

aphyr avatar beerriot avatar esstrifork avatar fakepop avatar jpease avatar peschkaj avatar roidrage avatar schofield avatar seancribbs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.