This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ordinality(n) { | |
| var s = '' + n, s1 = s[s.length-1], s10 = s[s.length-2] | |
| if(!s10 || s10 && s10 != 1) { | |
| if(s1 == 1) return s + 'st' | |
| if(s1 == 2) return s + 'nd' | |
| if(s1 == 3) return s + 'rd' | |
| } | |
| return s + 'th' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Load dependency libraries | |
| var http = require('http'), | |
| fs = require('fs'), | |
| path = require('path') | |
| // Create the http server | |
| var server = http.createServer(onRequest) | |
| // start the server | |
| server.listen(process.env.port || 8000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('app.controllers') | |
| .controller('mainCtrl', function($scope, $socket) { | |
| $scope.siteTitle = 'My Angular Site' | |
| $socket.connect('http://localhost:9999') | |
| $socket.on('welcome', function(data) { | |
| console.log('welcome', data) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p ns-tooltip="yo dawg">Paragraph with a tooltip.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp') // the main guy | |
| var clone = require('gulp-clone') // used to fork a stream | |
| var order = require('gulp-order') // reorder files in stream | |
| var uglify = require('gulp-uglify') // minify js | |
| var rename = require('gulp-rename') // rename file | |
| var concat = require('gulp-concat') // merge files together | |
| var stylus = require('gulp-stylus') // turn stylus into css | |
| var addsrc = require('gulp-add-src') // mid-stream gulp.src() | |
| var notify = require('gulp-notify') // OS-level notifications | |
| var plumber = require('gulp-plumber') // handle errors without crashing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp') // the main guy | |
| var order = require('gulp-order') // reorder files in stream | |
| var uglify = require('gulp-uglify') // minify js | |
| var rename = require('gulp-rename') // rename file | |
| var concat = require('gulp-concat') // merge files together | |
| var addsrc = require('gulp-add-src') // mid-stream gulp.src() | |
| var notify = require('gulp-notify') // OS-level notifications | |
| var plumber = require('gulp-plumber') // handle errors without crashing | |
| var annotate = require('gulp-ng-annotate') // safely minify angular | |
| var templateCache = require('gulp-angular-templatecache') // cache angular template files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <snippet> | |
| <content><![CDATA[ | |
| <?xml version="1.0"?> | |
| <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
| <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="${1}" height="${2}" viewBox="0 0 ${1} ${2}"> | |
| ${3} | |
| </svg> | |
| ]]></content> | |
| <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jshint asi: true | |
| var gulp = require('gulp') // the main guy | |
| var clone = require('gulp-clone') // used to fork a stream | |
| var notify = require('gulp-notify') // OS-level notifications | |
| var rename = require('gulp-rename') // rename files in a stream | |
| var stylus = require('gulp-stylus') // turn stylus code into css | |
| var plumber = require('gulp-plumber') // handle errors | |
| var beautify = require('gulp-cssbeautify') // make files human readable | |
| var sourcemap = require('gulp-sourcemaps') // write sourcemaps | |
| var minifycss = require('gulp-minify-css') // minify css code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>DOM Traversal</title> | |
| <style> | |
| .box1, .box2, .box3, .box4, .box5{ | |
| border: 1px solid black; | |
| padding: 1em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp') // the main guy | |
| var rename = require('gulp-rename') // rename files in a stream | |
| var stylus = require('gulp-stylus') // turn stylus code into css | |
| var plumber = require('gulp-plumber') // handle errors | |
| var sourcemap = require('gulp-sourcemaps') // write sourcemaps | |
| var minifycss = require('gulp-minify-css') // minify css code | |
| var autoprefix = require('gulp-autoprefixer') // prefix any css with low support | |
| gulp.task('css', function(){ |