Items in bold are those that I have the most experience.
- bundler - It manages your project's gem versions, so you don't have to. If you aren't using it, see me after class ಠ_ಠ
| # config/routes.rb | |
| Rails.application.routes.draw do | |
| # use json if format not defined in url | |
| scope(format: :json) do | |
| get :hello, controller: :sandbox | |
| end | |
| end | |
| # config/initializers/mime_types.rb | |
| # Define a custom Vendor MIME type |
| var gulp = require('gulp'); | |
| var myTransform = require('./myTransform'); | |
| gulp.task('foobar', function (){ | |
| return gulp.src("foobar.js") | |
| .pipe(myTransform()) | |
| .pipe(gulp.dest('.')); | |
| }); |
Items in bold are those that I have the most experience.
| app.directive('myOldDirective', function (myNewDirective) { | |
| var warnMsg = 'DEPRECATION WARNING: myOldDirective has been marked as deprecated ' + | |
| 'and will be removed in a future release. ' + | |
| 'Please use myNewDirective as a replacement.'; | |
| console.warn(warnMsg); // jshint ignore:line | |
| return myNewDirective[0]; | |
| }); |
| function currencyToPennies (currency) { | |
| // ensure string | |
| var strCurrency = currency.toString(); | |
| // ignore any character that's not part of a number | |
| var wholeAmount = strCurrency.replace(/[^0-9.]/g, ''); | |
| // locate decimal | |
| var decimalIndex = wholeAmount.indexOf('.'); | |
| var normalizedAmount; |
A collection of resources for developing native web apps.
| #!/usr/bin/env node | |
| 'use strict'; | |
| const Hexo = require('hexo'); | |
| const YAML = require('js-yaml'); | |
| const fs = require('fs'); | |
| const cwd = process.cwd(); | |
| exports.hexo = new Hexo(cwd); |
| (function () { | |
| var hashAnchors = document.querySelectorAll('a[href^="#"]'); | |
| /* | |
| Legacy browsers don't support NodeList.prototype.forEach, | |
| so we have to call Array.prototype.forEach setting the | |
| context to the NodeList. | |
| */ | |
| [].forEach.call(hashAnchors, function (anchor) { | |
| anchor.addEventListener('click', function (event) { |
A quick reference list of ::-ms-* prefixed pseudo elements.
| pseudo element | file | text | checkbox | radio | select | range | password | progress |
|---|---|---|---|---|---|---|---|---|
| ::-ms-browse | ☑ | |||||||
| ::-ms-check | ☑ | ☑ | ||||||
| ::-ms-clear | ☑ | |||||||
| ::-ms-expand | ☑ | |||||||
| ::-ms-fill | ☑ | |||||||
| ::-ms-fill-lower | ☑ |
| var fill = d3.scale.category20(); | |
| var layout = d3.layout.cloud() | |
| .size([500, 500]) | |
| .words([ | |
| "Hello", "world", "normally", "you", "want", "more", "words", | |
| "than", "this"].map(function(d) { | |
| return {text: d, size: 10 + Math.random() * 90, test: "haha"}; | |
| })) | |
| .padding(5) | |
| .rotate(function() { return ~~(Math.random() * 2) * 90; }) |