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
//file directory (fileDir) must end with a backslash "\" | |
private static void WriteFile(string fileDir, string fileName, string fileContent) | |
{ | |
System.IO.StreamWriter sw = new System.IO.StreamWriter(fileDir + fileName); | |
sw.Write(fileContent); | |
sw.Close(); | |
} |
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
// Getting a external handlebar template via jQuery.get() | |
// and compile template and register it to Ember | |
function loadTemplate(url, name, callback) { | |
var contents = $.get(url, function(data) { | |
var compiled = Ember.Handlebars.compile(data); | |
if (name) { | |
Ember.TEMPLATES[name] = compiled | |
} | |
else { | |
Ember.View.create({ template: compiled }).append(); |
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
// Format a /Date(XXXXXXXXXXXXXXXX)/ into a JSON date object. | |
angular.module('jsonDate', []).filter('jsonDate', function () { | |
return function (input, format) { | |
if (angular.isUndefined(input)) | |
return; | |
// first 6 character is the date | |
var date = new Date(parseInt(input.substr(6))); |
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
// Directive for autoNumeric.js | |
// Require AngularJS, jQuery and autoNumeric.js | |
angular.module('crunch.ui.numeric', []).directive('crNumeric', [function () { | |
'use strict'; | |
// Declare a empty options object | |
var options = {}; | |
return { | |
// Require ng-model in the element attribute for watching changes. | |
require: '?ngModel', | |
// This directive only works when used in element's attribute (e.g: cr-numeric) |
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
angular.module('my.app.routing', [], function ($routeProvider, $locationProvider) { | |
$routeProvider.when('/path', { | |
templateUrl: '/path/to/foo.html', | |
controller: FooControler | |
}); | |
$locationProvider.html5Mode(true); | |
}); |
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
// Copied from http://stackoverflow.com/a/1830844 | |
function isNumber(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
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
private void button1_Click(object sender, EventArgs e) | |
{ | |
var mail = new MailMessage(); | |
mail.From = new MailAddress(textBoxFrom.Text); | |
mail.To.Add(textBoxTo.Text); | |
mail.Subject = textBoxSubject.Text; | |
mail.IsBodyHtml = true; | |
string htmlBody; | |
htmlBody = textBoxMessage.Text; | |
mail.Body = htmlBody; |
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
[Flags] | |
public enum ExampleEnum | |
{ | |
A = 1 << 0, | |
B = 1 << 1, | |
C = 1 << 2, | |
D = 1 << 3, | |
E = 1 << 4, | |
} |
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
app.config(function ($httpProvider) { | |
$httpProvider.interceptors.push(function ($q, $rootScope) { | |
return { | |
'request': function (config) { | |
$rootScope.$broadcast('loading-started'); | |
return config || $q.when(config); | |
}, | |
'response': function (response) { | |
$rootScope.$broadcast('loading-complete'); | |
return response || $q.when(response); |
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
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
Enable-MicrosoftUpdate | |
Install-WindowsUpdate | |
Set-CornerNavigationOptions -EnableUsePowerShellOnWinX | |
Update-ExecutionPolicy | |
choco install git -y | |
choco install git-credential-winstore -y | |
choco install conemu -y | |
choco install diffmerge -y |
OlderNewer