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 responseJson = pm.response.json(); | |
pm.environment.set("token", responseJson.token); |
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
:root:not(.admin-area) { | |
--d-sidebar-width: 0; | |
} | |
html:not(.admin-area) { | |
.alert-emails-disabled, | |
.d-header, | |
.sidebar-wrapper { | |
display: none; |
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 { Alert, Col, Grid, Row } from 'react-bootstrap' | |
const GeneralError = () => ( | |
<Grid fluid> | |
<Row> | |
<Col xs={12}> | |
<Alert bsStyle="danger" style={{marginTop: '1em'}}> | |
<h4 style={{fontWeight: '600'}}>An error has occurred!</h4> | |
<p>Relaunch the content to ensure nothing is lost.</p> |
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 handleJSONResponse (response) { | |
return response.json() | |
.then(json => { | |
if (response.ok) return json | |
return Promise.reject({...json, responseObj: response}) | |
}) | |
} | |
export function handleTextResponse (response) { |
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
<?php | |
// Example of subclassing the base Exception class. Note that it doesn't HAVE to contain any code. | |
class FileWriteException extends Exception { | |
} | |
// Rule: When writing a function, you should throw exceptions for error management instead of returning a | |
// boolean. | |
// Rule: You should never throw Exception class directly. Instead, you should consider extending the Exception |
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
/* | |
DraftJS Slack - #general | |
Jimj 02/08/2018 [8:13 AM] | |
@ddelrio Simplest solution I found for continuing entities is, in beforeInputHanded : | |
*/ | |
const prev_char_space = this.getCharFromSelection() === ' ' | |
const new_char_space = char === ' ' | |
const prev_ent = this.getEntityAtSelection() | |
if (prev_ent && (!prev_char_space || !new_char_space)) { | |
const contentStateWithEntity = Modifier.insertText( |
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 const contentStateLogger = editorState => { | |
const result = JSON.stringify(convertToRaw(editorState.getCurrentContent()), null, 4); | |
const newResult = JSON.parse(result); | |
const contentState = JSON.stringify(newResult, null, 4); | |
// unquotes object keys | |
const keyQuotes = /"(.+)"(?=:)/g; | |
const newContentState = contentState.replace(keyQuotes, '$1'); | |
console.log(newContentState); | |
}; |