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
Person = Backbone.Model.extend({ | |
// default values of attributes | |
defaults:{ | |
age:0, | |
children: [] | |
}, | |
// validation | |
validate: function(attributes){ | |
if(attributes.age<0){ | |
console.log("Validation error, person can't be negative age!"); |
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
C:\cd C:\Chocolatey\chocolateyInstall | |
C:\Chocolatey\chocolateyinstall>nuget.exe update -self | |
Checking for updates from https://nuget.org/api/v2/. | |
Currently running NuGet.exe 2.1.0. | |
Updating NuGet.exe to 2.8.2-beta. | |
Update successful. |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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> | |
<head> | |
<title>Simple SVG "pipe"</title> | |
</head> | |
<body> | |
<canvas id='canvas' width='1024' height='800'></canvas> | |
<script> | |
var ctx = document.getElementById("canvas").getContext("2d"); | |
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
-- Using OPENROWSET | |
SELECT m.name, m.database_id | |
FROM OPENROWSET('SQLNCLI', 'Server=RemooteServerName;Trusted_Connection=yes;','SELECT * FROM master.sys.databases') AS m | |
-- Using OPENDATASOURCE | |
SELECT name, database_id | |
FROM OPENDATASOURCE('SQLNCLI','Data Source=RemooteServerName;Integrated Security=SSPI').master.sys.databases | |
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
-- This procedure will fail twice, first time in main TRY block and second time in CATCH statement because of converting ERROR_MESSAGE to INT | |
CREATE PROCEDURE dbo.SomeWork | |
AS | |
BEGIN TRY | |
-- let's do something | |
-- ... | |
-- Exception happens | |
PRINT 0/0 | |
END TRY |
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
-- 1.) Problematic way | |
-- This example will fail on a second execution (when first table not dropped, even in case it is executed in different connection or user context). | |
-- PK_SomeTable will already exist in tempdb | |
CREATE TABLE #SomeTable | |
( | |
Id INT IDENTITY(1, 1) , | |
[Name] [varchar](255) NULL , | |
CONSTRAINT [PK_SomeTable] PRIMARY KEY CLUSTERED ( [Id] ASC ) | |
) | |
-- Output: |
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
#Download file | |
Get-AzurePublishSettingsFile | |
#Import Publishing file | |
Import-AzurePublishSettingsFile -PublishSettingsFile "publishsettingsfile.publishsettings" | |
#List all profiles | |
Get-AzureSubscription | |
#Select active AzureSubscription |
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
%programfiles(x86)%\Microsoft Emulator Manager\1.0\emulatorcmd launch /sku:Android /id:0076019F-F03D-41CC-984F-D92FCBD52648 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer