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
class Foo { | |
constructor() { | |
this.feeling = '🤥' | |
} | |
speak() { | |
console.log(this.feeling) | |
} | |
} |
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 React, { Component } from 'react' | |
import { withRouter } from 'react-router-dom' | |
@withRouter | |
class BeforeLocationChange extends Component { | |
static propTypes = { | |
history: PropTypes.shape({ | |
before: PropTypes.func.isRequired, | |
}).isRequired, | |
handler: PropTypes.func.isRequired, |
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 { eventChannel } from 'redux-saga' | |
import { call, cps, take, fork, put, cancel, select } from 'redux-saga/effects' | |
function emitterChannel(emitter, eventType) { | |
return eventChannel(emit => { | |
emitter.on(eventType, emit) | |
return () => emitter.off(eventType, emit) | |
}) | |
} |
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 { eventChannel } from 'redux-saga' | |
function emitterChannel(emitter, eventType) { | |
return eventChannel(emit => { | |
emitter.on(eventType, emit) | |
return () => emitter.off(eventType, emit) | |
}) | |
} | |
describe('emitterChannel', () => { |
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 { eventChannel } from 'redux-saga' | |
function firebaseChannel(firebase, { | |
eventType = 'value', | |
returnSnapshot = false, | |
} = {}) { | |
return eventChannel(emit => { | |
const subscription = firebase.on(eventType, snapshot => { | |
emit(returnSnapshot ? { snapshot } : { value: snapshot.val() }) | |
}) |
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
const loaderUtils = require('loader-utils') | |
/** | |
* Turns a javascript object into sass variables | |
* @param {Object} obj POJO, values should be strings | |
* @param {String} options.prefix pre-pended to each sass variable | |
* @return {String} string to be injected into a Sass stylesheet | |
*/ | |
function sassify(obj, { prefix = '' } = {}) { | |
return Object.entries(obj).reduce((str, [key, 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
{ | |
positions: { | |
[id]: { | |
title: String, | |
receivedFrom: [Recruiter], | |
company: EmployingCompany, | |
description: String, | |
link: String, | |
receivedOn: Date, | |
teamSize: 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
// Bring in the core HTTP module | |
var http = require('http') | |
///////////////////////// | |
// Server code | |
///////////////////////// | |
// The in-memory state. Will be reset every time the server restarts! | |
var state = 'OFF' |
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 React from 'react'; | |
import radium from 'radium'; | |
const version = '4.4.0'; | |
const url = 'https://maxcdn.bootstrapcdn.com/font-awesome'; | |
const fontFace = ` | |
@font-face { | |
font-family: 'FontAwesome'; | |
src: url('${url}/${version}/fonts/fontawesome-webfont.eot?v=${version}'); |
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
// Making this a global and not exporting because Meteor | |
BetterError = class extends Error { | |
constructor(message, details) { | |
var stack = super().stack; | |
this.stack = stack; | |
this.message = message; | |
if (typeof details === 'object') { | |
details = JSON.stringify(details); | |
} | |
this.details = details; |
NewerOlder