- AngularJS: Factory vs Service vs Provider: Mr. McGinnis breaks down the differences between these.
- Learn Angular: Basic interactive lessons that start from the ground floor.
- “When to use service instead of factory” on StackOverflow: Practical breakdown of services versus factories, and recommended use cases.
- “Angularjs Tutorial for Beginners” on YouTube: A ~30 minute introduction to Angular.js basics by user LearnCode.academy.
- [“AngularJS Fundamentals In 60-ish Minutes” on YouTube](AngularJS Fundamentals In 60-ish Minutes): David Whalin’s brief introduction to Angular.js
- Official Angular.js Docs
- **“Angular.js ng-repeat :filter by single field” on StackOverflow
Grunt is “the JavaScript task runner” built on NodeJS. It does what it claims to do: run tasks. Gulp is a build tool that runs on NodeJS. In their words:
Gulp's use of streams and code-over-configuration makes for a simpler and more intuitive build.
Compiling Sass to CSS gives an excellent measure of the differences between Gulp and Grunt. These are taken straight from each project’s Readme.
/* global Modernizr */ | |
jQuery(function ($) { | |
'use strict'; | |
var SCREEN_SMALL = '(min-width: 768px)'; | |
/** | |
* "Welcome" onboarding message. | |
*/ | |
var $onboard = $('.onboard'); |
// Define the model | |
(function (angular) { | |
'use strict'; | |
var Model = function (data) { | |
this.id = data.ID; | |
this.name = this._getName(data); | |
}; | |
Model.prototype._getTitle = function (data) { | |
return data.firstName + ' ' + data.lastName; |
ShipStation has an XML API (PDF). Unfornately, because of poor PDF formatting, its impossible to properly copy-paste the XML validation schema. The following is the properly formated schema (as far as I can tell). Save it as a .xsd file and use it to validate your app’s output.
The email regular expression may change due to your language of choice. Originally, the PDF used:
([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+```
However, PHP didn’t like the \@
so I changed it to @
. Your mileage may vary.
/** | |
* Test Query builder. | |
*/ | |
'use strict'; | |
var _ = require('lodash'); | |
var config = require('config'); | |
var client = require('./lib/client').client; | |
var nav = require('./lib/nav/navigation')(client, config); | |
var micis = require('./lib/auth/micis')(client); |
var pattern = /url\(([^)]+)/g; | |
var cssBackgrounds = []; | |
var results = []; | |
var matches; | |
// Loop over every stylesheet and get the background image references in every | |
// `background: url(...)` | |
for (var i = 0, il = document.styleSheets.length; i < il; i++) { | |
for (var j = 0, jl = document.styleSheets[i].rules.length; j < jl; j++) { | |
if (document.styleSheets[i].rules[j].cssText.indexOf('url(') !== -1) { |
/** | |
* Parse Postgres's standard timestamps. | |
* | |
* Example: `Tue Jan 01 2019 00:00:00 GMT+0000 (UTC)` | |
* | |
* @todo Write tests! | |
*/ | |
var MONTHS = ['january', 'february', 'march', 'april', 'may', 'june', 'july', | |
'august', 'september', 'october', 'november', 'december']; |
'use strict'; | |
var fs = require('fs'); | |
var parse = require('css').parse; | |
var path = require('path'); | |
var files = []; // Add your files here | |
var filePaths = files.map(function(file) { | |
return path.join(__dirname, file); |
/** | |
* Get deeply nested objects using a 'compare' function. | |
* | |
* @param {(object|array)} target Data tree in which to find objects. | |
* @param {function} compare Passed items in the `target` data tree. It | |
* should return a boolean value based on the | |
* item. | |
* @return {array} | |
*/ | |
function getDeepObjects(target, compare) { |