This file contains 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
<span class="gallery-date">{{(gallery.date | date:'mediumDate') || "Various"}}</span> |
This file contains 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
// First, checks if it isn't implemented yet. | |
if (!String.prototype.format) { | |
String.prototype.format = function() { | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match | |
; | |
}); |
This file contains 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
// Base64 is not native, get a library or base64 outside of your script. | |
$http.defaults.headers.common['Authorization'] = 'Basic ' + Base64.encode($scope.login.login + ':' + $scope.login.password); |
This file contains 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
sc create newservice binpath= <pat_to_the_executable> |
This file contains 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 foo(a, b) | |
{ | |
a = typeof a !== 'undefined' ? a : 42; | |
b = typeof b !== 'undefined' ? b : 'default_b'; | |
} |
This file contains 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
/** | |
* Create the app | |
*/ | |
var appOne = angular.module('appOne', ['ngRoute']); | |
/** | |
* Configure routing - so controllerTwo runs | |
*/ | |
appOne.config(['$routeProvider', function($routeProvider) { | |
$routeProvider.when('/', { |
This file contains 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
To make the environment variable accessible globally you need to set it in the registry. As you've realised by just using: | |
set NEWVAR=SOMETHING | |
you are just setting it in the current process space. According to this page you can use the setx command: | |
setx NEWVAR SOMETHING | |
setx is built into Windows 7, but for older versions may only be available if you install the Windows Resource Kit |
This file contains 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 myApp = angular.module('myApp', []); | |
myApp.directive('collapsible', function () { | |
/** | |
* We need this since by the time we get to link, | |
* the original HTML is already gone, replaced by template. | |
*/ | |
var originalHTML = {}; | |
return { |
This file contains 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> | |
<html ng-app="app"> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body ng-controller="MyCtrl"> | |
{{serviceOutput}} | |
<br/><br/> |
This file contains 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.$on('$locationChangeStart', function (event, newLoc, oldLoc){ | |
console.log('changing to: ' + newLoc); | |
}); | |
scope.$on('$locationChangeSuccess', function (event, newLoc, oldLoc){ | |
console.log('changed to: ' + newLoc); | |
}); |