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
| // hat-tip to Brent Burgoyne | |
| document.evaluate("//*[contains(text(), 'foo')]", document.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue |
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
| otto | |
| https://ottoproject.io/ | |
| https://github.com/hashicorp/otto | |
| deis | |
| https://deis.com/ | |
| https://github.com/deis/deis | |
| has 5 full-time devs | |
| flynn |
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
| router('/foo', async function(ctx) { | |
| ctx.unsubscribe = await doStuff() | |
| }) | |
| router('/foo', async function(ctx) { | |
| ctx.unsubscribeMore = await doMoreStuff() | |
| }) | |
| router.after('/foo', async function(ctx) { | |
| await doMoreStuff(ctx) |
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
| /* @flow */ | |
| import React from 'react' | |
| type QuoteProps = { | |
| message: string, | |
| quote: string, | |
| name: string, | |
| photoUrl: string, | |
| photoAlt: string |
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
| // ES7 | |
| getPlayers() | |
| ::map(x => x.character()) | |
| // ES6 | |
| let _val | |
| _val = getPlayers() | |
| _val = map(_val, x => x.character()) |
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
| // Confused? See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Array_comprehensions | |
| function flatten(previous, current) { | |
| return previous.concat(current) | |
| } | |
| var productImages = [ | |
| for(section of CatalogSections) [ | |
| for(placement of section.ProductPlacements) [ | |
| for(item of placement.ProductPlacementItems) [ |
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
| // Modified from: https://gist.github.com/rpflorence/1f72da0cd9e507ebec29 | |
| var React = require('react/addons') | |
| var merge = require('lodash-node/modern/objects/assign') | |
| function makeStubbedElement(Component, props, contextStubs) { | |
| var TestWrapper = React.createClass({ | |
| displayName: 'StubbedElement', |
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
| npm install jiff --save |
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
| describe('as a super administrator', function() { | |
| it('create a session', async function(done) { | |
| var { | |
| user, | |
| password | |
| } = await fixtures(['User'], { | |
| user: { superAdministrator: true } | |
| }) | |
| request(app) |
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
| $('.ghx-columns .ghx-column').each(function() { | |
| var columnPoints = 0; | |
| var dataColumnId = $(this).data('column-id'); | |
| $(this).find('.aui-badge').each(function() { | |
| columnPoints += parseInt($(this).text(),10); || 0 | |
| }); | |
| var h2 = $('#ghx-column-headers .ghx-column[data-id=' + dataColumnId + '] h2'); | |
| var span = h2.find('span'); | |
| if(!span.length) { | |
| span = $('<span class="badge" style="margin-left: 6px;"></span>'); |