Skip to content

Instantly share code, notes, and snippets.

@SimplyAhmazing
SimplyAhmazing / docker.md
Last active December 15, 2016 17:58
Docker ProTips
  • First things first, install VirtualBox
  • Use docker-machine to provision "default" docker VM (no longer use boot2docke, ever!)

Enable port forwarding on your VM,

for i in {10000..10999}; do
    VBoxManage modifyvm "default" --natpf1 "tcp-port$i,tcp,,$i,,$i";
    VBoxManage modifyvm "default" --natpf1 "udp-port$i,udp,,$i,,$i";
done

API Builders script source,

import json
import os
import random
import sys
import subprocess
import time
@SimplyAhmazing
SimplyAhmazing / sm1.py
Created April 24, 2017 14:23
Sample Smart Modules Protocol
from opentrons import robot, instruments, containers
from opentrons import smart_module
md = smart_module.MagDeck()
md.connect('/dev/tty123')
sh = smart_module.Shaker()
sh.connect('/dev/tty124')
@SimplyAhmazing
SimplyAhmazing / smart_modules_api.md
Last active April 27, 2017 18:38
Smart Modules API

Smart Modules API (sample)

Instruments (attached to the robot)

Pipette

pump = instruments.Pipette(axis='a', ...)
pump.dispense(volume, <location>)
@SimplyAhmazing
SimplyAhmazing / ot_proto.py
Created May 9, 2017 16:47
Protocol Workout
num_samples = 8
DNA_delay = 6
heat_shock_delay = 6
cold_delay = 6
DNA_vol = 2
cell_vol = 25
total_vol = 27
LB_vol = 200
@SimplyAhmazing
SimplyAhmazing / command-queue-less-api-example.py
Last active August 2, 2017 20:04
Shows an example of using the Opentrons API in Jupyter
# To use this API:
#
# Uninstall previously installed API
# pip uninstall -y opentrons
#
# Install API from here
# pip install "git+https://github.com/opentrons/opentrons@release-2.5.0#egg=opentrons&subdirectory=api"
# imports
from opentrons import robot, containers, instruments
@SimplyAhmazing
SimplyAhmazing / call_depth.py
Last active July 24, 2017 18:33
Track call depth of a method relative to other methods in a class
import inspect
def call_depth(instance):
methods_to_consider = [
func_name
for func_name, _ in inspect.getmembers(
instance, predicate=inspect.ismethod)
]
stack_funcs = [i.function for i in inspect.stack()]
@SimplyAhmazing
SimplyAhmazing / submodules-for-ci.md
Last active July 26, 2017 15:17
Git submodules on CI Notes

Add to Travis

before_install:
    - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
    - git submodule update --init --recursive

or apply sed call to repo:

Made some updates to this PR due after following up on the error Akash got in running the tests locally. In turn this past week I have to come to learn a lot about Visual Regression Testing that I want to share here and discuss with you all. The things I want to share are organized in these topics,

  • Non deterministic rendering of images
  • Electron/Chrome non deterministic states
  • Visual regression work flows
  • Tools & Literature

On Non deterministic rendering

@SimplyAhmazing
SimplyAhmazing / electron-notes.md
Created January 31, 2018 19:28
Electron Notes

Sign an electron dev executable,

$ codesign --deep --force --verbose --sign - node_modules/electron/dist/Electron.app