Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Marino mgmarino

View GitHub Profile
View example-voila-stack.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Voila Microservice Stack
Parameters:
Environment:
Type: String
AllowedValues:
- staging
- production
ECRRegistry:
View export-temp-credentials.py
import configparser
import os
import boto3
import sys
import random
import string
def fail(msg):
sys.stderr.write("{}\n".format(msg))
sys.exit(1)
View reset-temp-credentials.py
import configparser
import os
import boto3
import sys
def fail(msg):
print(msg)
sys.exit(1)
aws_profile = os.getenv("AWS_DEFAULT_PROFILE")
View convert.js
var jwkToPem = require("jwk-to-pem");
var jwk = JSON.parse(process.env.OAUTH_TOKEN_KEY)
var output = {
signingKey: jwkToPem(jwk, {
private: true
}),
verifierKey: jwkToPem(jwk, {
private: false
})
View TestWithHickle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View TestWithHickle.py
# coding: utf-8
# In[1]:
import numpy
import itertools
import h5py
# make an array with a lot of stuff
@mgmarino
mgmarino / Move files using Dropbox SDK.md
Last active October 19, 2021 03:11
Move all files to another folder using Dropbox python SDK
View Move files using Dropbox SDK.md

Move files from one folder to another using Dropbox python SDK

A script to move all files from one folder to another in dropbox. It expects a JSON file credentials.json in the same directory of the form:

{
  "accessToken": "ACCESS_TOKEN",
  "sourceFolder": "/src_folder",
  "destinationFolder": "/dest_folder"
}
View keybase.md

Keybase proof

I hereby claim:

  • I am mgmarino on github.
  • I am mikemarino (https://keybase.io/mikemarino) on keybase.
  • I have a public key ASAIGPtdpd5bBv6KvKHsHC9UxPObznQYc1RLm4WzumGbdQo

To claim this, I am signing this object:

View remove_measurements.py
import pynedm
import json
# Authentication
po = pynedm.ProcessObject(uri="http://raid.nedm1:5984",
username="admin",
password="""pw"""
)
acct = po.acct
View post_file_to_db.py
"""
Script to upload documents t the measurements DB.
Usage: python {} doc_id file_one [file_two] ... [file_n]
"""
import pynedm
from clint.textui.progress import Bar as ProgressBar
import json
import sys
from glob import iglob