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
| $scope.addList = function() { | |
| var newList = $scope.newList.trim(); | |
| if (!newList.length) { | |
| return; | |
| } | |
| lists.push({ | |
| listId: Slug.slugify(newList + '-' + lists.length), | |
| title: newList, |
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
| // Monitor the current route for changes and adjust the filter accordingly. | |
| $scope.$on('$routeChangeSuccess', function () { | |
| if ($routeParams.listId) { | |
| var listId = $routeParams.listId.split("-").pop() | |
| var list = lists[listId]; | |
| if (list !== undefined && list !== $scope.currentList) { | |
| $scope.currentList = list; | |
| $scope.setTasks(); | |
| } else if (list !== $scope.currentList) { |
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'; | |
| /* Controllers */ | |
| var taskListControllers = angular.module('taskListControllers', []); | |
| taskListControllers.controller('TaskListCtrl', function TaskListCtrl($scope, $routeParams, $filter, $location, storage, Slug) { | |
| 'use strict'; | |
| var LIST_STORAGE_ID = 'lists'; | |
| storage.bind($scope, LIST_STORAGE_ID); |
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
| <li ng-class="{active: currentList.title == list.title}" ng-repeat="list in lists track by $index"> | |
| <a data-toggle="tab" href="#{{list.listId}}"> | |
| <span class="badge pull-right">{{list.remainingCount}}</span> | |
| <div class="destroy pull-right glyphicon glyphicon-trash" ng-click="removeList(list)"></div> | |
| <strong>{{list.title}}</strong> | |
| </a> | |
| </li> |
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
| body> | |
| <div ng-view></div> | |
| <!-- In production use: | |
| <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script> | |
| --> | |
| <script src="bower_components/angular/angular.js"></script> | |
| <script src="bower_components/angular-route/angular-route.js"></script> | |
| <script src="bower_components/angular-cookies/angular-cookies.js"></script> |
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
| <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> | |
| <link href="css/app.css" media="all" rel="stylesheet"> | |
| <link href="bower_components/animate.css/animate.min.css" media="all" rel="stylesheet" type="text/css" /> | |
| <link href="css/animations.css" media="all" rel="stylesheet"> | |
| <link href="bower_components/font-awesome/css/font-awesome.min.css" media=all rel=stylesheet /> | |
| <script src="bower_components/modernizr/modernizr.js"></script> |
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> | |
| <!--[if lt IE 7]> <html lang="en" ng-app="taskListApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html lang="en" ng-app="taskListApp" class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html lang="en" ng-app="taskListApp" class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html lang="en" ng-app="taskListApp" class="no-js"> <!--<![endif]--> |
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
| # encoding: binary | |
| require 'active_model/validator' | |
| class EmailValidator < ActiveModel::EachValidator | |
| EmailAddress = begin | |
| qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]' | |
| dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]' | |
| atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-' + | |
| '\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+' |
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
| ## This gist is intended to provide a code example for the | |
| # 'Making Signed Requests' section of the 'Authentication Overview' document. | |
| # (http://developer.netflix.com/docs/Security). | |
| # | |
| # We are going to make a catalog request. The hardest part of | |
| # it is figuring out how to generate the oauth_signature. | |
| require 'cgi' | |
| require 'base64' | |
| require 'openssl' |
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
| class PdfMerger | |
| def merge(pdf_paths, destination) | |
| first_pdf_path = pdf_paths.delete_at(0) | |
| Prawn::Document.generate(destination, :template => first_pdf_path) do |pdf| | |
| pdf_paths.each do |pdf_path| | |
| pdf.go_to_page(pdf.page_count) |