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 aFunction(event) { | |
event.preventDefault(); | |
} | |
it("submit is prevented", function() { | |
var ev = new Event('submit', {'bubbles':true, 'cancelable':false}); | |
spyOn(ev, 'preventDefault'); | |
aFunction(ev); |
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
describe("Search", function() { | |
//css should be included in Karma config | |
var divElem = document.createElement('div'); | |
divElem.id = 'sample-div'; | |
document.body.appendChild(divElem); | |
it("sample div should be hidden", function() { | |
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
.tree-view { | |
font-size: 130%; | |
} | |
.list-tree li.list-nested-item > .list-item { | |
line-height: 1.5em; | |
} | |
.tree-view .project-root.project-root > .header .name { | |
line-height: 1.5em; |
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
const recurringAddons = [{description: 'limited calls'}, {description: 'unlimited calls'}]; | |
const hasUnlimitedCalls = R.propEq('description', 'unlimited calls'); | |
const unlimitedCallsAddon = R.find(hasUnlimitedCalls)(recurringAddons) | |
const moveItFirst = addon => R.pipe(R.without([addon]), R.prepend(addon)) | |
moveItFirst(unlimitedCallsAddon)(recurringAddons); |
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
const combineReducers = reducers => ( | |
state, | |
action, | |
) => reducers.reduce( | |
( | |
newState, | |
reducer, | |
) => reducer( | |
newState, | |
action, |
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 addDelay(msg: string, ms: number) { | |
return () => { | |
setTimeout(() => { | |
console.log(msg); | |
}, ms); | |
}; | |
} | |
const delayedSayHello = addDelay("Hello world!", 500); | |
delayedSayHello(); / |
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 wait(seconds: number, data: any) { | |
return new Promise(resolve => setTimeout(() => resolve(data), seconds * 1000)); | |
} | |
// wait 5 seconds | |
await wait(5) |
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
Import-Module posh-git | |
Import-Module posh-alias | |
function prompt { "> " } | |
Add-Alias status 'git status' | |
Add-Alias push 'git push' | |
Add-Alias pull 'git pull --rebase' |