The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
| <body> | |
| <h1>Day 10</h1> | |
| <h2><a href="">Script tag logic example</a></h2> | |
| <script> | |
| alert('This is JavaScript alert. Look around your screen and note that there is no image right now.'); | |
| </script> | |
| <img src="http://js.ework.me/code/d10-script-tag/bateaumatineeFA.jpg"> |
| var getRelationship = function(x, y) { | |
| // If both arguments are numbers | |
| if ( !isNaN(x) && !isNaN(y) ) { | |
| if ( x == y ) { // if they are equal, return '=' | |
| return '='; | |
| } else { // if not, return comparison operator | |
| return x < y ? '<' : '>'; |
| var moonWalkers = [ | |
| "Neil Armstrong", | |
| "Buzz Aldrin", | |
| "Pete Conrad", | |
| "Alan Bean", | |
| "Alan Shepard", | |
| "Edgar Mitchell", | |
| "David Scott", | |
| "James Irwin", | |
| "John Young", |
| // Iterate through the localizedRuleNames in ruleResults and | |
| // return an array of their strings. | |
| function ruleList(results) { | |
| var ruleResults = results.formattedResults.ruleResults; | |
| var localizedRuleNamesArray = []; | |
| for (var key in ruleResults) { | |
| // Iterate through object's own properties only |
| // Include Gulp and all required plugins | |
| var gulp = require('gulp'); | |
| var less = require('gulp-less'); | |
| var autoprefixer = require('gulp-autoprefixer'); | |
| var minifyCSS = require('gulp-minify-css'); | |
| var gutil = require('gulp-util'); | |
| var sourcePath = 'src/custom'; | |
| var targetPath = 'assets/css'; |
| { | |
| "name": "App Name", | |
| "version": "0.0.1", | |
| "homepage": "http://myapp.com", | |
| "repository": { | |
| "type": "git", | |
| "url": "https://github.com/app" | |
| }, | |
| "author": { | |
| "name": "Nadi", |
| { | |
| "countries": [ | |
| { | |
| "country": "Afghanistan", | |
| "states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"] | |
| }, | |
| { | |
| "country": "Albania", | |
| "states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"] | |
| }, |
| <!-- | |
| AngularJS directive | |
| type: AE | |
| 1. pass a field name (e.g. "formName.fieldName") into the "messages-for" attribute; | |
| 2. pass a scope expression that returns "true" when users tries to submit the given form | |
| --> | |
| <!-- Validate Messages directive starts --> | |
| <div validate-messages messages-for="siteForm.siteName" submitted="submitted"></div> |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| sass: { | |
| dist: { | |
| options:{ | |
| style:'compressed' | |
| }, | |
| files: { | |
| 'css/style.css' : 'scss/style.scss' |