🏋️♂️
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
<script> | |
document.write( | |
'<script src="' + env.ASSETS_HOST + '/javascripts/shared/shared.js">\x3C/script>' | |
); | |
document.write( | |
'<link rel="stylesheet" href="' + env.ASSETS_HOST + '/stylesheets/shared.css" />' | |
); | |
</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
TCPServer.new('127.0.0.1', 0).addr[1] |
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('partials', []) | |
.run(['$templateCache', function($templateCache) { | |
return $templateCache.put('/partials/content.html', [ | |
'', | |
'<div class="main-content">', | |
' <div ui-view="Main"></div>', | |
' <div class="push"></div><span ng-include="\'/partials/footer.html\'"></span>', | |
'</div>',''].join("\n")); | |
}]) | |
.run(['$templateCache', function($templateCache) { |
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.run ['$http', '$injector', 'SecurityConstants', ($http, $injector, SecurityConstants) -> | |
$http.get("#{SecurityConstants.assetsHost}/templates/partials.html").then((response) -> | |
$injector.get('$compile') response.data | |
response | |
) | |
] |
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('StudentHunter.ExtensionsModule').factory 'AssetsPartialsLoader', | |
['$http', '$injector', 'SecurityConstants', ($http, $injector, SecurityConstants) -> | |
load: -> | |
$http.get("#{SecurityConstants.assetsHost}/templates/partials.html").then (response) -> | |
$injector.get('$compile') response.data | |
response | |
] |
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
$stateProvider | |
.state 'anonymous', | |
abstract: true | |
resolve: | |
assetsPartials: ['AssetsPartialsLoader', (AssetsPartialsLoader) -> | |
AssetsPartialsLoader.load() | |
] |
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
describe 'ExtensionsModule', -> | |
beforeEach module 'StudentHunter.Constants' | |
beforeEach module 'StudentHunter.ExtensionsModule' | |
beforeEach module 'StudentHunter.SecurityModule' | |
beforeEach module 'ui.router' | |
describe '$templateCache decorator', -> | |
beforeEach module ($provide) -> | |
$provide.decorator '$compile', ($delegate) -> | |
return jasmine.createSpy $delegate |
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 class="templates templates_partials"> | |
<script id="templates/shared/translate/lang_switch.html" type="text/ng-template"> | |
<ul class="lang-switch" ng-controller="TranslateCtrl as translate"> | |
<li class="lang-switch__lang lang-switch__lang--en"> | |
<button class="lang-switch__btn" ng-class="{'lang-switch__lang--current': translate.isCurrentLang('en')}" ng-click="translate.changeLang('en')" type="button"></button> | |
</li> | |
<li class="lang-switch__lang lang-switch__lang--pl"> | |
<button class="lang-switch__btn" ng-class="{'lang-switch__lang--current': translate.isCurrentLang('pl')}" ng-click="translate.changeLang('pl')" type="button"></button> | |
</li> | |
</ul> |
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
describe 'ExtensionsModule', -> | |
beforeEach module 'StudentHunter.Constants' | |
beforeEach module 'StudentHunter.SecurityModule' | |
beforeEach module 'StudentHunter.ExtensionsModule' | |
describe "AssetsPartialsLoader load", -> | |
beforeEach module ($provide) -> | |
$provide.decorator '$compile', ($delegate) -> | |
return jasmine.createSpy $delegate |
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
[1] (pry) main: 0> my_hash = Hash.new [] | |
=> {} | |
[2] (pry) main: 0> my_hash[:hobbies] << 'dancing'; | |
[3] (pry) main: 0> my_hash[:hobbies] << 'swimming'; | |
[4] (pry) main: 0> my_hash[:skills] << 'java'; | |
[5] (pry) main: 0> my_hash[:skills] << 'php'; | |
[6] (pry) main: 0> my_hash[:skills] | |
=> ["dancing", "swimming", "java", "php"] | |
[7] (pry) main: 0> my_hash[:some_random_key] | |
=> ["dancing", "swimming", "java", "php"] |