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('io.utils', []) | |
| module.directive('ioTypeahead', [ | |
| '$parse', | |
| function ($parse) { | |
| return { | |
| restrict: "AE", | |
| replace: true, | |
| transclude: false, | |
| compile: function (element, attrs) { | |
| var modelAccessor = $parse(attrs.ioTypeahead); |
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('io.utils', []) | |
| .factory('parseRelaxJson', [function () { | |
| // XXX: 대충 만들었음... 제대로 할라믄 귀찮아... 글타고 라이브러리 가져다 쓰기도 그렇고... | |
| // `{abc:` --> `{"abc":` or `,abc:` --> `,"abc":` | |
| var PROPERTY_KEY_RELAX = /(\{|,)\s*(.+?)\s*:/g; | |
| var PROPERTY_KEY_STRICT = '$1"$2":'; | |
| return function (str) { | |
| try { | |
| return JSON.parse(str); | |
| } catch (e) { |
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('io.utils', []) | |
| .filter('prettyJson', [function () { | |
| return function (obj, pretty) { | |
| if (!obj) { | |
| return ''; | |
| } | |
| var json = angular.toJson(obj, pretty); | |
| if (!pretty) { | |
| return json; | |
| } |
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
| DROP TABLE IF EXISTS accounts; | |
| CREATE TABLE accounts (name VARCHAR(100), balance INT); | |
| INSERT INTO accounts VALUES('foo', 100); | |
| INSERT INTO accounts VALUES('bar', 200); | |
| INSERT INTO accounts VALUES('baz', 300); | |
| INSERT INTO accounts VALUES('qux', 400); | |
| SELECT * FROM accounts; |
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 debugEnabledTags = []; | |
| var debugDisabledTags = []; | |
| (window.DEBUG || '*').split(/[\s,]+/).forEach(function (tag) { | |
| tag = tag.replace('*', '.*?'); | |
| if (tag[0] === '-') { | |
| debugDisabledTags.push(new RegExp('^' + tag.substr(1) + '$')); | |
| } else { | |
| debugEnabledTags.push(new RegExp('^' + tag + '$')); |
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 detectBrowser() { | |
| var name = navigator.appName; | |
| var version = navigator.appVersion; | |
| var ua = navigator.userAgent; | |
| var nameMatches = ua.match(/(chrome|safari|firefox|msie|opera)\/?\s*(\.?\d+(\.\d+)*)/i); | |
| if (nameMatches) { | |
| name = nameMatches[1]; | |
| var versionMatches = ua.match(/version\/([\.\d]+)/i); | |
| if (versionMatches) { |
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
| diff -uNr node_modules/mongoose-3.6.14/History.md node_modules/mongoose/History.md | |
| --- node_modules/mongoose-3.6.14/History.md 2013-07-06 07:16:15.000000000 +0900 | |
| +++ node_modules/mongoose/History.md 2013-07-17 04:07:52.000000000 +0900 | |
| @@ -1,4 +1,13 @@ | |
| +3.6.15 / 2013-07-16 | |
| +================== | |
| + | |
| + * added; mongos failover support #1037 | |
| + * updated; make schematype return vals return self #1580 |
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
| // truncatechars 필터 정의 | |
| angular.module('filters', []) | |
| .filter('truncatechars', function() { | |
| return function(text, maxlen) { | |
| return (text.length - 3 < maxlen) | |
| ? text | |
| : text.substring(0, maxlen-3) + '...'; | |
| }; | |
| }); |
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
| // my-rating 지시자 정의 | |
| angular.module('directives', []) | |
| .directive('my-rating', function() { | |
| return function(scope, element, attrs) { | |
| var tags = ''; | |
| var n = (isNaN(attrs.myRating) | |
| ? 0 : parseFloat(attrs.myRating); | |
| for (var i = 0; i < 5; i++) { | |
| var suffix = ((i < n) ? 'full' : 'empty'); | |
| tags += '<img src="star-' + suffix + '.png" />'; |
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
| <html ng-app="app"> | |
| <body ng-controller="mainCtrl"> | |
| <header> | |
| <div ng-include="'common-header.html'"></div> | |
| <div ng-show="currentUser"> | |
| <p>Welcome, {{currentUser.userame}}!</p> | |
| <button ng-click="logout()">Logout</login> |