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 { graphql } from 'react-relay'; | |
import { getNode } from 'relay-runtime'; | |
const ShoesListQuery = graphql` | |
query ShoesListQuery { | |
shoes { | |
size | |
type | |
} | |
} |
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 readline = require('readline'); | |
const childProcess = require('child_process'); | |
const readlineInterface = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
readlineInterface.question(`Digite o nome do projeto que queira abrir: \n`, (input) => { |
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 path = require('path'); | |
const {spawn} = require('child_process'); | |
(() => { | |
const mongod = spawn('mongod', [], {cwd: 'c:/Program Files/MongoDB/Server/4.2/bin'}); | |
mongod.stdout.on('data', (data) => { | |
console.log(`${data}`); | |
}); | |
})() |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'filterNgxMultiselect' | |
}) | |
export class FilterNgxMultiselectPipe implements PipeTransform { | |
transform(arrayNgxMultiselect: {key: string, value: string | number}[], stringToFilter: string): any { | |
return !!arrayNgxMultiselect ? | |
arrayNgxMultiselect.filter(item => `${item.value}`.toLowerCase().trim().includes(stringToFilter.toLowerCase().trim()) || item.key.toLowerCase().trim().includes(stringToFilter.toLowerCase().trim())) : |
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 [formValidation, setFormValidation] = useState<UserFormValidation>({ | |
emailIsValid: false, | |
cpfIsValid: false, | |
nomeIsValid: false, | |
cepIsValid: false, | |
ruaIsValid: false, | |
numeroIsValid: false, | |
bairroIsValid: false, | |
cidadeIsValid: false, | |
showErrors: false |
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 AsyncStorage from "@react-native-community/async-storage"; | |
const asyncStorage = <T,>(key: string) => { | |
const getValue = async (): Promise<T | null> => { | |
const value = await AsyncStorage.getItem(key); | |
return value ? JSON.parse(value) : null; | |
}; |
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 { asyncStorageModule } from "../asyncStorage"; | |
import { getUniqueId } from "react-native-device-info"; | |
class Device { | |
private _device: string = ''; | |
private _isFetching = false; | |
private static _instance: Device; | |
private _deviceAsyncStorageModule = asyncStorageModule<string>('device'); | |
private constructor() {} |
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 { RequestParameters } from 'relay-runtime/lib/util/RelayConcreteNode'; | |
import { Variables, Disposable } from 'relay-runtime/lib/util/RelayRuntimeTypes'; | |
import { SubscriptionClient, Observer } from 'subscriptions-transport-ws'; | |
import config from '../config'; | |
import { ExecutionResult } from 'graphql'; | |
import { Observable, SubscribeFunction, Subscribable, GraphQLResponse } from 'relay-runtime'; | |
import { RelayObservable } from 'relay-runtime/lib/network/RelayObservable'; | |
export function getToken(): string { |
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 { AbstractControl } from "@angular/forms"; | |
export function passwordMatchValidator(control: AbstractControl): {[key: string]: boolean} | null { | |
const password = control.get('password'); | |
const passwordRepeat = control.get('passwordRepeat'); | |
const passwordErrors = { ...password.errors }; | |
const passwordRepeatErrors = { ...passwordRepeat.errors }; | |
if (password.value !== passwordRepeat.value) { | |
password.setErrors({passwordMatchValidator: true}); | |
passwordRepeat.setErrors({passwordMatchValidator: true}); |
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
/// <reference lib="webworker" /> | |
addEventListener('message', ({ data }) => { | |
const response = `worker response to ${data.lista}`; | |
const objMessageReturn = { | |
value: data.lista[0], | |
halfDown: null, | |
halfUp: null | |
}; | |
if (data.lista.length > 1) { |
NewerOlder