Skip to content

Instantly share code, notes, and snippets.

View intellij templates.md

Has field live template, suggested name: hf

public boolean has$SET_NAME$() {
  return hasFieldSet("$SET_NAME$");
}

PresenceTrackingSetter Template,

#set($paramName = $helper.getParamName($field, $project))
View hash.c
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int key;
int val;
struct node *next;
View electron-notes.md

Sign an electron dev executable,

$ codesign --deep --force --verbose --sign - node_modules/electron/dist/Electron.app
View pr-msg.md

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 / submodules-for-ci.md
Last active Jul 26, 2017
Git submodules on CI Notes
View submodules-for-ci.md

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:

@SimplyAhmazing
SimplyAhmazing / call_depth.py
Last active Jul 24, 2017
Track call depth of a method relative to other methods in a class
View call_depth.py
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 / command-queue-less-api-example.py
Last active Aug 2, 2017
Shows an example of using the Opentrons API in Jupyter
View command-queue-less-api-example.py
# 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
View ot_proto.py
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
View smart_modules_api.md

Smart Modules API (sample)

Instruments (attached to the robot)

Pipette

pump = instruments.Pipette(axis='a', ...)
pump.dispense(volume, <location>)
@SimplyAhmazing
SimplyAhmazing / sm1.py
Created Apr 24, 2017
Sample Smart Modules Protocol
View sm1.py
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')