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
/** | |
* Note that this script is intended to be included at the *end* of the document, before </body> | |
*/ | |
(function (window, document) { | |
if ('open' in document.createElement('details')) return; | |
// made global by myself to be reused elsewhere | |
var addEvent = (function () { | |
if (document.addEventListener) { | |
return function (el, type, fn) { |
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
// knockout 2.2.1 | |
ko.utils.arrayFilter = function (array, predicate) { /* .. */ } | |
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ } | |
ko.utils.arrayForEach = function (array, action) { /* .. */ } | |
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ } |
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
// Basic approach. Does not try to register in | |
// a CommonJS environment since jQuery is not likely | |
// to run in those environments. See next file | |
// if you want to opt in to CommonJS too. | |
(function(factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(['jquery'], factory); | |
} else { |
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
// Add at the top with the other Usings | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
//Add following methods inside the file | |
private bool IsNullable(TypeUsage usage) | |
{ | |
return (bool)usage.Facets.First(facet => facet.Name == "Nullable").Value; | |
} | |
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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.Linq; | |
/// <summary> | |
/// A dictionary that remembers the order that keys were first inserted. If a new entry overwrites an existing entry, the original insertion position is left unchanged. Deleting an entry and reinserting it will move it to the end. | |
/// </summary> | |
/// <typeparam name="TKey">The type of keys</typeparam> |
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
public class RequireRouteValuesAttribute : ActionMethodSelectorAttribute { | |
public string[] ValueNames { get; private set; } | |
public RequireRouteValuesAttribute(params string[] valueNames) { | |
ValueNames = valueNames; | |
} | |
/// <summary> | |
/// Check for all strings | |
/// </summary> |
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
declare @tableName varchar(200) | |
declare @columnName varchar(200) | |
declare @nullable varchar(50) | |
declare @datatype varchar(50) | |
declare @maxlen int | |
declare @sType varchar(50) | |
declare @sProperty varchar(200) | |
DECLARE table_cursor CURSOR FOR |
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 () { | |
// IndexedDB | |
function BrowserType() { | |
var n = navigator.appName; | |
var ua = navigator.userAgent; | |
var tem; | |
var m = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); | |
if (m && (tem = ua.match(/version\/([\.\d]+)/i)) != null) m[2] = tem[1]; | |
m = m ? [m[1], m[2]] : [n, navigator.appVersion, '-?']; |
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
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln | |
# Get the path that the user specified when calling the script | |
$solution = $args[0] | |
$solutionPath = Split-Path $solution -Parent | |
$solutionName = Split-Path $solution -Leaf | |
# Delete the .nuget directory and all contents | |
Remove-Item (Join-Path $solutionPath ".nuget") -Force -Recurse -ErrorAction 0 |
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 is now a module: | |
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines-- | |
var template = require('backtick-template'); | |
// just string | |
const info = 'template'; | |
`some ${info}` === template('some ${info}', {info}); |
OlderNewer