Runs a connect web server, serving files from /client on port 3000.
| // set the default amount of items being displayed | |
| $scope.limit= 5; | |
| // loadMore function | |
| $scope.loadMore = function() { | |
| $scope.limit = $scope.items.length | |
| } |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
| cd /wherever/sites/the-site | |
| sudo chown -R _www wordpress-folder | |
| sudo chmod -R g+w wordpress-folder |
| /** | |
| * Workaround to make defining and retrieving angular modules easier and more intuitive. | |
| */ | |
| (function(angular) { | |
| var origMethod = angular.module; | |
| var alreadyRegistered = {}; | |
| /** |
I recently switched a project from Development to Production Mode on cloud.typography, uploaded the files to S3, and none of the fonts were rendering completely.
It seems that Amazon's web uploader doesn't assign the correct MIME types for .eot files.
Make sure that the Content-Type for your .eot files is 'application/vnd.ms-fontobject'
Your .css files should have a Content-Type of 'text/css'
| module.exports = function(grunt) { | |
| grunt.loadNpmTasks('grunt-contrib-compass'); | |
| grunt.loadNpmTasks('grunt-autoprefixer'); | |
| grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
| grunt.loadNpmTasks('grunt-contrib-uglify'); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); | |
| grunt.initConfig({ |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
| // Intercepting HTTP calls with AngularJS. | |
| angular.module('MyApp', []) | |
| .config(function ($provide, $httpProvider) { | |
| // Intercept http calls. | |
| $provide.factory('MyHttpInterceptor', function ($q) { | |
| return { | |
| // On request success | |
| request: function (config) { | |
| // console.log(config); // Contains the data about the request before it is sent. |
| RB.filter('daterange', function () | |
| { | |
| return function(conversations, start_date, end_date) | |
| { | |
| var result = []; | |
| // date filters | |
| var start_date = (start_date && !isNaN(Date.parse(start_date))) ? Date.parse(start_date) : 0; | |
| var end_date = (end_date && !isNaN(Date.parse(end_date))) ? Date.parse(end_date) : new Date().getTime(); |