Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ralph Effting ralfting

🏠
Working from home
Block or report user

Report or block ralfting

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View locations.json
This file has been truncated, but you can view the full file.
[
{
"zip_code": 501,
"latitude": 40.922326,
"longitude": -72.637078,
"city": "Holtsville",
"state": "NY",
"county": "Suffolk"
},
View order.css
.declaration-order {
/* Positioning */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
/* Box Model */
View ComposeEmailHeader.jsx
const headerClass: string =
isCcMinimized & isBccMinimized & !isReplyingAll
? 'pp-both-min'
: isCcMinimized | isBccMinimized
? 'pp-one-min'
: '';
View ComposeEmailHeader-test.js
it('should have min class by default depending on props', () => {
props.isReplyingAll = true;
const wrapper = shallow(<ComposeEmailHeader {...props} />);
expect(wrapper.hasClass('pp-both-min')).toBeFalsy();
expect(wrapper.hasClass('pp-one-min')).toBeTruthy();
});
View ComposeEmailInput-test.js
describe('Email badge', () => {
it('adds two email', () => {
const { container, getByTestId } = render(<EmailInput setTo={jest.fn()} {...props} />);
container.querySelector('input').value = 'example1@pipefy.com,';
fireEvent.keyUp(container.querySelector('input'), {
key: 'Backspace',
});
container.querySelector('input').value = 'example2@pipefy.com,';
View ComposeEmailInput.jsx
setValues = (v: string): void => {
const lastChar = v.slice(-1);
const isComma = lastChar === ',';
const isSpace = lastChar === ' ';
if (isComma || isSpace) {
const delimiter = /,| /;
const notEmptyText = text => text.length > 0;
const emails = v
.slice(0, -1)
View USCities.js
{
"zip_code": 501,
"latitude": 40.922326,
"longitude": -72.637078,
"city": "Holtsville",
"state": "NY",
"county": "Suffolk"
},
View ComposeEmailInput.jsx
class EmailInput extends React.Component<Props, State> {
state = {
emailList: [],
inputValue: '',
}
setValues = (value: string) => {
let v = value;
if (v.length > 1 && (v.slice(-1) === ',' || v.slice(-1) === ' ')) {
let list = [...this.state.emailList, v.slice(0, -1)];
View index.js
import data from './USCities.js';
const autoCompletejs = new autoComplete({
data: {
src: () => {
console.log(data)
return data;
},
key: ["city"],
cache: false
View index.js
const arr = [1,2,3,4];
let newArr = [];
const fetchMock = (item) =>
new Promise(resolve => setTimeout(() => resolve(item), 500));
function someFunc() {
[1,2,3,4].forEach(async (item) => {
const result = await fetchMock(item);
newArr.push(result);
You can’t perform that action at this time.