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
// 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
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
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
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
/** | |
* Returns a function mixed with an object. | |
* @param obj - Object to mix. | |
* @param func - Target function. | |
*/ | |
function mixWithFunc<T extends Function>(obj: { __proto__?}, func: T) { | |
var objProto = <{ constructor }>obj.__proto__; | |
var objClass = <{ __mixedProto__ }>objProto.constructor; | |
var proto = <typeof obj>objClass.__mixedProto__; | |
if (!proto) { |
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 static class AnonymousTypeHelper | |
{ | |
public static T Cast<T>(T typeHolder, object x) | |
{ | |
return (T)x; | |
} | |
public static T GetNull<T>(T typeHolder) where T : class | |
{ | |
return null; |
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
// Windows Script Host APIS | |
// http://blogs.msdn.com/b/freik/archive/2012/10/19/goofing-around-with-typescript-amp-windows-script-host.aspx | |
declare var ActiveXObject: { new (s: string): any; }; | |
interface IWScriptStringCollection { | |
Item(n: number): string; | |
Count: number; | |
length: number; | |
} |
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
// https://stackoverflow.com/a/31930918/5171110 | |
var module: { exports: any }; | |
var exports = { | |
sham: (() => { | |
var sham = ((moduleName: string) => { | |
exports = { sham }; | |
module = sham.modules[moduleName] = { exports }; | |
}) as { | |
(moduleName: string): void; |
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.ComponentModel; | |
using System.Drawing; | |
using System.Globalization; | |
using System.Runtime.InteropServices; | |
using System.Security.Permissions; | |
namespace System.Windows.Forms | |
{ | |
/// <summary> | |
/// Represents a splitter control that enables the user to resize docked controls. |