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 { join } from 'path'; | |
export const TEMP_DIRECTORY = join(__dirname, '..', '.temp'); |
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
#!/bin/sh | |
set -e | |
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | | |
while read path_key path | |
do | |
url_key=$(echo $path_key | sed 's/\.path/.url/') | |
url=$(git config -f .gitmodules --get "$url_key") | |
git submodule add $url $path |
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
export function cors(fn: NextApiHandler, methods = ['GET']) { | |
return async (request: NextApiRequest, response: NextApiResponse) => { | |
const allowedMethods = [...methods, 'OPTIONS'].join(','); | |
response.setHeader('Access-Control-Allow-Credentials', 'true'); | |
response.setHeader('Access-Control-Allow-Origin', '*'); | |
response.setHeader('Access-Control-Allow-Methods', allowedMethods); | |
response.setHeader( | |
'Access-Control-Allow-Headers', | |
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Authorization, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version', |
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
@@ -0,0 +1,21 @@ | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import ReactHtmlParser from 'react-html-parser'; | |
export default class HtmlWrapper extends React.Component { | |
static propTypes = { | |
element: PropTypes.oneOfType([ | |
PropTypes.string, | |
PropTypes.object, |
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
export function slugify(input = '') { | |
return removeAccents(input) | |
.replace(/[\u0300-\u036f]/g, '') | |
.replace(/[()]/g, '') | |
.replace(/ /g, '-') | |
.replace(/[|^{}%"<>\\`]/g, '') | |
.toLowerCase(); | |
} |
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
/** | |
* Remove accents | |
*/ | |
export function removeAccents(input: string) { | |
const removalMap = { | |
A: /[AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄ]/g, | |
AA: /[Ꜳ]/g, | |
AE: /[ÆǼǢ]/g, | |
AO: /[Ꜵ]/g, | |
AU: /[Ꜷ]/g, |
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
# EditorConfig helps developers define and maintain consistent | |
# coding styles between different editors and IDEs | |
# editorconfig.org | |
root = true | |
[*] | |
# change these settings to your own preference | |
indent_style = space | |
indent_size = 4 |
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 React from 'react'; | |
import { autobind } from 'core-decorators'; | |
import d3 from 'd3'; | |
import moment from 'moment'; | |
import classNames from 'classnames'; | |
export default class EvolutionChart extends React.Component { | |
static propTypes = { | |
investment: React.PropTypes.object.isRequired, | |
size: React.PropTypes.array, |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
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 randomID(size = 6) { | |
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
let text = ''; | |
for (let i = 0; i < size; i++) { | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
} | |
return text; | |
} |
NewerOlder