Skip to content

Instantly share code, notes, and snippets.

@dmitry-mukhin
dmitry-mukhin / list_cvs.py
Created August 31, 2022 12:05
Get all Uploadcare files in CVS
### 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')
@xeoncross
xeoncross / mysql.py
Last active February 16, 2024 03:10
Example database class for wrapping mysql-connector for python
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)
@michal-wrzosek
michal-wrzosek / api.Dockerfile
Created December 3, 2019 02:05
yarn workspaces and Docker
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
@missioncloud
missioncloud / delete_recovery_points.py
Created April 20, 2019 20:08
Simple Python3 script to remove recovery points from an AWS Backup Vault. Used as an interim solution until a `force_delete` option becomes available.
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')

Fire up Lando!

Ensure all projects are up and running.

Seed data

You first need to put some users in the database. You do this by running this test command from inside your panda directory: lando yarn test:seed

This will out the users added to your screen.

@BretFisher
BretFisher / docker-compose.yml
Created November 10, 2017 18:13
Docker Compose local development with wildcard DNS for multi-domain development
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:
@robinedman
robinedman / GettingStarted.md
Last active July 9, 2018 15:05
Getting started: Node.js and related technologies

Getting started with Node.js development

Installing

Install nvm for managing versions. This allows you to install and switch between different Node versions.

Then install the latest version of Node with:

nvm install stable
@mroderick
mroderick / sinon-array-test.js
Created August 9, 2017 08:24
A sample which shows that you cannot stub the `Array.prototype.filter` method. All works fine for `Array.prototype.map`.
'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 ] );
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# 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)