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
### Get all files stored in your Uploadcare project in CSV. | |
import pyuploadcare | |
import csv | |
from pyuploadcare import Uploadcare | |
uploadcare = Uploadcare(public_key='public', | |
secret_key='secret') |
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 mysql.connector | |
# from mysql.connector import Error | |
# pip3 install mysql-connector | |
# https://dev.mysql.com/doc/connector-python/en/connector-python-reference.html | |
class DB(): | |
def __init__(self, config): | |
self.connection = None | |
self.connection = mysql.connector.connect(**config) |
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 node:10-alpine as build | |
WORKDIR /usr/src/app | |
COPY package.json . | |
COPY yarn.lock . | |
COPY packages/shared ./packages/shared | |
COPY packages/api ./packages/api | |
RUN yarn install --pure-lockfile --non-interactive |
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 boto3 | |
from time import sleep | |
from sys import argv | |
def get_recovery_points(vault_name: str) -> list: | |
pagination = True | |
restore_points = [] | |
b = boto3.client('backup') |
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
version: '3' | |
# vcap.me is a wildcard domain that resolves to localhost | |
# in case you need to pass URL's around from browser to | |
# containers this could help you get around localhost problem | |
services: | |
# use www.vcap.me to access web containter from host | |
# use api.vcap.me to access api container from host | |
proxy: |
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
'use strict'; | |
const sinon = require( 'sinon' ); | |
const expect = require( 'chai' ).expect; | |
describe( 'Array.prototype', () => { | |
describe( 'map()', () => { | |
it( 'uses native map', () => { | |
const callback = sinon.spy(); | |
const stub = sinon.stub( Array.prototype, 'map' ).returns( [ 2, 4 ] ); |
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
# Pass the env-vars to MYCOMMAND | |
eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
# … or ... | |
# Export the vars in .env into your shell: | |
export $(egrep -v '^#' .env | xargs) |
NewerOlder