Updated for Rails 4.0.0+
-
Set up the
bowergem. -
Follow the Bower instructions and list your dependencies in your
bower.json, e.g.// bower.json
{
| // Linear Congruential Generator | |
| // Variant of a Lehman Generator | |
| var lcg = (function() { | |
| // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes | |
| // m is basically chosen to be large (as it is the max period) | |
| // and for its relationships to a and c | |
| var m = 4294967296, | |
| // a - 1 should be divisible by m's prime factors | |
| a = 1664525, | |
| // c and m should be co-prime |
Updated for Rails 4.0.0+
Set up the bower gem.
Follow the Bower instructions and list your dependencies in your bower.json, e.g.
// bower.json{
| // Algorithm to calculate the Lowest Common Denominator | |
| @function gcd($a, $b){ | |
| @if $b == 0 { | |
| @return $a; | |
| } @else { | |
| @return gcd($b, $a%$b); | |
| } | |
| } | |
| // Example Use-case: |
| /** | |
| * Returns PBKDF2 derived key from supplied password. | |
| * | |
| * Stored key can subsequently be used to verify that a password matches the original password used | |
| * to derive the key, using pbkdf2Verify(). | |
| * | |
| * @param {String} password - Password to be hashed using key derivation function. | |
| * @param {Number} [iterations=1e6] - Number of iterations of HMAC function to apply. | |
| * @returns {String} Derived key as base64 string. | |
| * |
| To allow c9 workspace to push to github org repository you must allow it in 3rd party access setup https://github.com/organizations/<org>/settings/oauth_application_policy | |
| Either remove restrictions or allow it from your https://github.com/settings/applications |
| const R = require('ramda') | |
| const colors = ['green', 'blue', 'red'] | |
| const notEmpty = R.compose(R.not, R.isEmpty) | |
| const minLength = a => b => R.length(b) > a | |
| const hasPresetColors = x => R.indexOf(x, colors) !== -1 | |
| const input = { | |
| id: 1, | |
| userName: 'Random', |