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
import { Api } from 'api' | |
class PromiseAccessSingleton { | |
public constructor () { this.init() } | |
private dataPromise: Promise<any> | |
private init (): void { | |
this.dataPromise = Api.GetData().then(data => { | |
// Transform `data` if needed... |
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
// We use the _.debounce method to prevent hundreds of unnecessary recalculations during click-and-drag resizing. | |
import * as _ from 'underscore' | |
import Vue, { ComponentOptions } from 'vue' | |
// This interface and the `as` statements at the end are the only TypeScript artifacts in this file. They can be removed | |
// for regular ES6 projects. | |
interface IResponsiveBus extends Vue { | |
handleResize: () => void | |
isMobile: boolean | |
} |
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
'use strict'; | |
// Imagine there's a page helper that provides access to actual page elements in a unified place | |
var loginPage = require('./Helpers/Login.helper.js'); | |
var fs = require('fs'); | |
exports.config = { | |
specs: ['**/*.spec.js'], | |
capabilities: { | |
browserName: 'chrome', |
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
{ | |
"plugins": ["stylelint-order"], | |
"processors": ["stylelint-processor-html"], | |
"extends": "stylelint-config-standard", | |
"rules": { | |
"indentation": 2, | |
"no-empty-source": null, | |
"order/properties-alphabetical-order": true, | |
"selector-type-no-unknown": [true, { | |
"ignore": ["custom-elements"] |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"allowSyntheticDefaultImports": true, | |
"alwaysStrict": true, | |
"lib": ["es6", "dom"], | |
"module": "es2015", | |
"moduleResolution": "node", | |
"noImplicitAny": true, | |
"noImplicitReturns": true, | |
"sourceMap": true, |
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
export interface recursiveArray extends Array<number | Array<any>> { } | |
export function flattenArray(arrayToFlatten: recursiveArray = []): Array<number> { | |
let workingArray: Array<number> = [] | |
for (const value of arrayToFlatten) { | |
if (Array.isArray(value)) { | |
workingArray = workingArray.concat(flattenArray(value)) | |
} else { | |
workingArray.push(value) |
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
alias wow='git status' | |
alias such='git' | |
alias very='git' | |
alias wutido='git log -n 3' | |
alias loljk='git reset HEAD~' | |
alias aginagin='fc -s' | |
alias loool='git reset --hard HEAD' | |
alias wat='git diff' |
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; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
// Put this in whatever namespace you want, then construct and run it in an Integration test. | |
// The Run() method returns an exit code where 0 means the test was successful and anything else means it wasn't. | |
// So just assert that the result of Run() is 0, like so: `Assert.AreEqual(0, resultOfProtractorHelperDotRun);` | |
public class ProtractorHelper | |
{ | |
private readonly string _configPath; |
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
'use strict'; | |
// "source" should be the name of a text file (the '.txt' extension is assumed, so leave it off), | |
// formatted as follows: | |
/* | |
:css selector: | |
Text content for this 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
var levenshteinArray = function (item, itemArray, howMany) { | |
return itemArray.map(function (arrayItem) { | |
return { | |
item: arrayItem, | |
distance: splitLevDist(item, arrayItem) | |
}; | |
}).sort(function (a, b) { | |
return a.distance - b.distance; | |
}).slice(0, howMany).map(function (item) { | |
return item.item; |
NewerOlder