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 () { | |
'use strict'; | |
angular | |
.module('PBDesk.Toastr') | |
.controller('ToastrTestController', ToastrTestController); | |
ToastrTestController.$inject = ['$scope', 'Toastr', 'ToastrFactory']; | |
function ToastrTestController($scope, Toastr, ToastrFactory) { |
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 () { | |
'use strict'; | |
angular | |
.module('app') | |
.controller('controller2', controller2); | |
controller2.$inject = ['$scope']; | |
function controller2($scope) { |
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
npm cache clean -f | |
npm i -g <package> # -S --save | |
npm i -S <package> # -S --save | |
npm i -D <package> # -D --save-dev | |
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
using (TailspinToysEntities context = new TailspinToysEntities()) | |
{ | |
context.Database.Log = s => System.Diagnostics.Debug.WriteLine(s); | |
var products = | |
from product in context.Products | |
where product.BasePrice > 5.00m | |
select product; | |
} |
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
# Generates a <machineKey> element that can be copied + pasted into a Web.config file. | |
function Generate-MachineKey { | |
[CmdletBinding()] | |
param ( | |
[ValidateSet("AES", "DES", "3DES")] | |
[string]$decryptionAlgorithm = 'AES', | |
[ValidateSet("MD5", "SHA1", "HMACSHA256", "HMACSHA384", "HMACSHA512")] | |
[string]$validationAlgorithm = 'HMACSHA256' | |
) | |
process { |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote | |
#Set of commands i use to rename feature/15.0 to feature/SignupRefactor locally and remotely | |
#rename local feature/15.0 to feature/SignupRefactor | |
git branch -m feature/15.0 feature/SignupRefactor | |
#delete remote feature/15.0 |
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
//using System.Net; | |
//using System.Net.Mail; | |
MailMessage mail = new MailMessage(); | |
SmtpClient SmtpServer = new SmtpClient("<smtp host address>"); | |
mail.From = new MailAddress("[email protected]"); | |
mail.To.Add("[email protected]"); | |
mail.Subject = "Subject"; | |
mail.Body = "body"; |
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
{ | |
"name": "WebApp", | |
"version": "0.0.0", | |
"description": "WebApp NodeJS Simple WebSite", | |
"main": "server.js", | |
"author": { | |
"name": "Pinal Bhatt", | |
"email": "[email protected]" | |
}, | |
"dependencies": { |
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
//Chocolatey Install Package | |
cinst packageName | |
//Chocolatey Update | |
cup packageName | |
cup all | |
clist -lo |
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
/* | |
C# Generic String Parser Extension Method | |
Code Snippet By: Pinal Bhatt [www.PBDesk.com] | |
http://blogs.pbdesk.com/c-generic-string-parser-extension-method/ | |
Working Example at http://ideone.com/ZP5xo | |
Usage: | |
string s = "32"; | |
int i = s.As<int>(); | |
*/ |