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
| app.service('CurrencyExchange', function($http, $q) { | |
| // using public API for currency exchange rates | |
| return function (from, rates) { | |
| var deferred = $q.defer(); | |
| var base = from.toUpperCase(); | |
| var currencies = []; | |
| if (typeof rates === 'string') { | |
| currencies = base + '_' + rates.toUpperCase(); |
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
| // define app | |
| angular.module('app', []) | |
| // listen to state changes | |
| .config(function($rootScope) { | |
| $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState) { | |
| // redirectTo | |
| if (toState.redirectTo) { | |
| event.preventDefault(); | |
| $state.go(toState.redirectTo, toParams); |
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
| String.prototype.rot17 = function() { | |
| return this.replace(/[ა-ჱ]/g, function(c) { | |
| c = c.charCodeAt() + 17; | |
| return String.fromCharCode(c <= 4337 ? c : c - 34); | |
| }); | |
| }; |
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
| .columns(@property: 1) { | |
| & > .cell { | |
| width: 100% / @property; | |
| } | |
| } | |
| .generate-row(@n, @i: 1) when (@i =< @n) { | |
| &.row@{i} { | |
| .columns(@i); | |
| } |
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
| 'use strict' | |
| module.exports = function (grunt) { | |
| grunt.initConfig({ | |
| options: { | |
| command: 'touch', | |
| args: '', | |
| filepath: '', | |
| file: '' | |
| }, |
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
| <!-- The original idea came from https://github.com/nathanford/data-href --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body> | |
| <section> | |
| <p data-href="#/paragraph/url/"> |
NewerOlder