Skip to content

Instantly share code, notes, and snippets.

View nicolasmelo1's full-sized avatar
🤡

Nicolas Leal nicolasmelo1

🤡
View GitHub Profile
import { stdin as input, stdout as output } from 'process';
import { emitKeypressEvents } from 'readline';
function clearConsole(lengthOfOptions) {
//adapted from sindresorhus ansi-escape module
const ESC = '\u001B['
const eraseLine = ESC + '2K';
const cursorUp = (count = 1) => ESC + count + 'A'
const cursorLeft = ESC + 'G'
/**
* Isso é uma factory function, basicamente é como se tivesse instanciando uma classe, mas faço isso com function,
* prefiro esse padrão do que usar classes. Eu tenho que chamar essa função globalmente antes de começar o app.
*
* IMPORTANTE: Não demorei nem 10 minutos fazendo essa porcaria, então sei lá, recomendo algo mais parrudão pra usar em prod.
* Principalmente algo com tipagem melhor que vc consiga listar os eventos disponiveis e os parâmetros que cada callback recebe.
*/
function simplePubSubFactory() {
const subscribed = new Map<string, Map<symbol, (...args: any[]) => void>>
import { AppState, Linking } from "react-native";
import { useEffect, useRef, useState } from "react";
import { Audio, InterruptionModeIOS } from "expo-av";
import { getNetworkStateAsync } from "expo-network";
import Voice, {
SpeechRecognizedEvent,
SpeechResultsEvent,
} from "@react-native-voice/voice";
import BackgroundTimer from "react-native-background-timer";
{
"app_id": 1966818,
"billing_address": {
"address1": "2259 Park Ct",
"address2": "Apartment 5",
"city": "Drayton Valley",
"company": null,
"country": "Canada",
"first_name": "Christopher",
"last_name": "Gorski",
/**
* This function exists to allow us to use setTimeout in a way that doesn't block the UI thread.
*
* Instead of using setTimeout, we use requestAnimationFrame to call the function recursively until the timeout is reached.
*
* This will enable us to render smooth animations while the timeout is running.
*/
export function setLayoutTimeout(
callback: (...args: any) => any,
timeout: number,
import { AppState, Linking } from "react-native";
import { useEffect, useRef, useState } from "react";
import { Audio, InterruptionModeIOS } from "expo-av";
import { getNetworkStateAsync } from "expo-network";
import { uuid, logging } from "../utils";
import {
SNIPPET_LENGTH_IN_MILLISECONDS,
setLayoutTimeout,
clearLayoutTimeout,
import puppeteer, { Page } from "puppeteer";
const INSTAGRAM_HOST = "https://www.instagram.com/";
export default async function instagram(
username: string,
password: string,
options?: { headless: boolean }
) {
const [page, browser] = await initialize();
"use client";
import cookieParser from "./default";
const cookie = cookieParser(
typeof document === "undefined" ? "" : document?.cookie || ""
);
export default cookie;
var customerRefund = nlapiCreateRecord('customerrefund');
customerRefund.setFieldValue('customer', '111736');
customerRefund.setFieldValue('currency', '1');
customerRefund.setFieldValue('account', '217');
customerRefund.setFieldValue('trandate', new Date());
customerRefund.setFieldValue('paymentmethod', '14');
const creditCount = customerRefund.getLineItemCount('apply');
const creditMemoIndex = customerRefund.findLineItemValue('apply', 'internalid', '4498596');
"""
ASGI config for reflow_server project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""