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
declare module Bucks { | |
export interface SingleMethods<T extends Element> { | |
<T extends Element>(selector: string): SingleResult<T>; | |
find<T extends Element>(selector: string): SingleResult<T>; | |
visible(): SingleResult<T>; | |
withAttribute(attributeName: string, regExp: RegExp): SingleResult<T>; | |
getAttribute(attributeName: string): string; | |
closest<T extends Element>(selector: string): SingleResult<T>; | |
all: ListMethods<Element>; |
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
declare interface MaybeFunction { | |
<T1>(a: T1): T1; | |
<T1, T2>(a: T1, b: (_: T1) => T2): T2; | |
<T1, T2, T3>(a: T1, b: (_: T1) => T2, c: (_: T2) => T3): T3; | |
<T1, T2, T3, T4>(a: T1, b: (_: T1) => T2, c: (_: T2) => T3, d: (_: T3) => T4): T4; | |
} | |
var maybe = <MaybeFunction>function() { | |
let result = arguments[0]; | |
for (let i = 1, len = arguments.length; i < len; i++) { |
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
let findUniquePair = numbers => | |
((xor, n1) => [n1, n1 ^ xor]) ( | |
...((xor, xors) => [xor, xors.find(n => n && n != xor) || 0]) ( | |
...numbers.reduce( | |
(r, n) => [ r[0] ^ n, r[1].map((val, i) => val ^ (n & (2 ** i) && n)) ], | |
[0, new Uint32Array(32)]))); | |
let numbers = findUniquePair([10, 20, 9, 10, 3, 20]); | |
console.log(numbers); // [3, 9] |
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
// UI Theme: One Light | |
// Syntax Theme: Atom Light | |
atom-text-editor, atom-text-editor::shadow { | |
font-family: "Lucida Sans Typewriter"; | |
font-size: 14px; | |
color:#111; | |
.variable { | |
color:#248; | |
} |
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
javascript:void($('.ghx-column[data-id="18"],.ghx-column[data-column-id="18"]').toggle()) |
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
static toDictionary<TItem>( | |
array: TItem[], | |
getKey: (item: TItem) => number): { [id: number]: TItem }; | |
static toDictionary<TItem, TValue>( | |
array: TItem[], | |
getKey: (item: TItem) => number, | |
getValue: (item: TItem) => TValue): { [id: number]: TValue }; | |
static toDictionary<TItem>( | |
array: TItem[], | |
getKey: (item: TItem) => string): { [id: string]: TItem }; |
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
SELECT o.name, i.name, ddius.* FROM sys.dm_db_index_usage_stats ddius | |
JOIN sys.indexes i ON ddius.object_id = i.object_id AND ddius.index_id = i.index_id | |
JOIN sys.objects o ON i.object_id = o.object_id | |
WHERE ddius.database_id = DB_ID() |
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
// cscript waitUrl.js http://alm-build/TimeTracker/dev/test/favicon.ico | |
var url = WScript.Arguments(0); | |
var status = 0; | |
var WinHttpReq = new ActiveXObject('WinHttp.WinHttpRequest.5.1'); | |
for (var i = 0; i < 30; i++) { | |
WScript.Sleep(1000); | |
WinHttpReq.Open('GET', url, false); | |
WinHttpReq.Send(); | |
status = WinHttpReq.Status; |
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
public class TokenContainer | |
{ | |
public string Access_token { get; set; } | |
} | |
var request = new RestRequest("/core/connect/token", Method.POST); | |
request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); | |
request.AddParameter("grant_type", "client_credentials"); | |
request.AddParameter("client_id", "CLIENT_ID"); | |
request.AddParameter("client_secret", "CLIENT_SECRET"); |
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
-- for each... | |
DECLARE @ItemId INT | |
DECLARE ItemCursor CURSOR FOR | |
SELECT ItemId | |
FROM Items | |
WHERE ... | |
OPEN ItemCursor | |
WHILE 1 = 1 | |
BEGIN | |
FETCH NEXT FROM ItemCursor INTO @ItemId |