These rules are adopted from the AngularJS commit conventions.
/** | |
* Changes value to past tense. | |
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
* http://jsfiddle.net/bryan_k/0xczme2r/ | |
* | |
* @param {String} value The value string. | |
*/ | |
Vue.filter('past-tense', function(value) { | |
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
var vowels = ['a', 'e', 'i', 'o', 'u']; |
let csrfToken = 'lololololol'; | |
let axiosDefaults = require('axios/lib/defaults'); | |
axiosDefaults.headers.common['X-CSRF-Token'] = csrfToken; |
{# Get URL of single file field #} | |
{{ node.field_file.entity.uri.value }} | |
{# Get URL of multi file field #} | |
{{ node.field_file['#items'].entity.uri.value }} | |
{# Trun into link #} | |
{{ file_url(node.field_file.entity.uri.value) }} | |
{# Check if there is at least one value #} |
Note: I had issues with setting up my Facebook app so authentication would work. I'd receive the error at the bottom, and it took me a while to figure out what was wrong
Here are the steps I took:
- Go to
http://developers.facebook.com/
, create, and setup your app - When inside the dashboard, click "Settings"
- Click "Add Platform"
- Choose website (for authentication via the web app)
- Add
http://localhost:3000/
as "Site URL" (and "Mobile URL" if necessary) - Add
localhost
to "App Domains" above
import express from "express"; | |
/** | |
* Takes a route handling function and returns a function | |
* that wraps it after first checking that the strings in | |
* `reserved` are not part of `req.body`. Used for ensuring | |
* create and update requests do not overwrite server-generated | |
* values. | |
*/ | |
function checkReservedParams(routeHandler, ...reserved) { |
A JavaScript module allowing addition and removal of multiple events and callback handlers. Its most useful feature is the ability to keep track of attached event handlers. Multiple event handlers can be attached and removed to/from a specific event. The module allows removal of all event listeners at the same time for a specific event, or all listeners for all events, if the user so desires.
- Can be used with collections, or with a single DOM object.
- Works on older browsers.
This module was inspired by this answer at Stack Overflow: http://stackoverflow.com/a/4386514
A simple example using Event module can be seen here: http://codepen.io/zakirt/pen/tjkEg
<?php | |
/** | |
* Controller is the customized base controller class. | |
* All controller classes for this application should extend from this base class. | |
*/ | |
class RestController extends CController | |
{ | |
/** | |
* @var string the default layout for the controller view. Defaults to '//layouts/column1', | |
* meaning using a single column layout. See 'protected/views/layouts/column1.php'. |
This doc will guide you through installing Mongo DB using WSL through the Command Line.
Most of the steps are listed out here, but this guide will trim them down and make it more straight forward for our needs. There is also 1 step that is not in the link above as well, which will be noted when we come across it.
- Follow the directions listed on the mongodb official website for your distro of choice.