The package linked to from here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
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
from os import listdir,SEEK_END | |
from os.path import isfile, join, getmtime | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import socketserver | |
import time | |
import subprocess | |
import select | |
from urllib.parse import parse_qs,urlparse | |
import logging | |
import sys, os, socket |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
HTTP server that provides a web interface to run "tail" on a file, | |
like the Unix command. | |
This is a standalone script. No external dependencies required. | |
How to invoke: |
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
CREATE OR REPLACE FUNCTION random_int_array(dim integer, min integer, max integer) RETURNS integer[] AS $BODY$ | |
begin | |
return (select array_agg(round(random() * (max - min)) + min) from generate_series (0, dim)); | |
end | |
$BODY$ LANGUAGE plpgsql; | |
-- usage example | |
select random_int_array(15, 6, 40); | |
-- return example |
- Change your database RDS instance security group to allow your machine to access it.
- Add your ip to the security group to acces the instance via Postgres.
- Make a copy of the database using pg_dump
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
- you will be asked for postgressql password.
- a dump file(.sql) will be created
- Restore that dump file to your local database.
- but you might need to drop the database and create it first
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
- the database is restored
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
// tests/nexus-test-environment.js | |
const NodeEnvironment = require('jest-environment-node') | |
const { nanoid } = require('nanoid') | |
const util = require('util') | |
const exec = util.promisify(require('child_process').exec) | |
const fs = require('fs') | |
const path = require('path') | |
const prismaBinary = './node_modules/.bin/prisma' |
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
FROM adminer:4.7.1 | |
# WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING | |
MAINTAINER [email protected] | |
USER root | |
RUN apk add autoconf gcc g++ make libffi-dev openssl-dev | |
RUN pecl install mongodb | |
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini |
NewerOlder