Skip to content

Instantly share code, notes, and snippets.

View yury-sannikov's full-sized avatar

Yuriy Sannikov yury-sannikov

View GitHub Profile
FROM timongentzsch/l4t-ubuntu20-base:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -yqq git python3.8 python3.8-dev python3-pip build-essential curl wget cmake
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
RUN \
EXT_PATH=~/external && \
mkdir -p $EXT_PATH && cd $EXT_PATH && \
git clone https://github.com/pybind/pybind11.git
@yury-sannikov
yury-sannikov / viseron_docker_Dockerfile
Created December 11, 2021 14:29
Viseron with GStreamer
## For the sake of simplicity I put in into the Dockerfile to set up gstreamer and PyGObject
# Gstreamer
RUN apt-get update \
&& apt-get install -y --no-install-recommends gstreamer1.0-tools gstreamer1.0-alsa \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev
@testMethod('checkSeatings should return rejected promise on error')
@inject(null, 'error')
@testMethod('checkSeatings should return rejected promise if seats and capacity doesnt match')
@inject({sections: [{seats: 1}], ticketQuantityAvailable: 5}, null)
@inject({sections: [{seats: 1}, {seats: 2}], ticketQuantityAvailable: 5}, null)
@testMethod('checkSeatings should return resolved promise')
@inject({sections: [{seats: 1}, {seats: 2}, {seats: 2}], ticketQuantityAvailable: 5}, null)
checkSeatings(result, error, done) {
@testMethod('handleFieldUpdatedEvent should exit if event secondaryGroup does not match')
@inject('cmpSecondaryGroup', 'eventSecondaryGroup', null)
@testMethod('handleFieldUpdatedEvent should call updateFieldVisibility')
@inject('secondaryGroup', 'secondaryGroup', null)
handleFieldUpdatedEvent(secondaryGroup, eventSecondaryGroup, secondaryIdElements) {
const event = eventFactory({secondaryGroup: eventSecondaryGroup})
const component = componentFactory({secondaryGroup, findMap: {value: [true, true]}})
controller.handleFieldUpdatedEvent(component, event, helper);
@yury-sannikov
yury-sannikov / FUNcon-2017-testClass
Last active September 22, 2017 17:37
mocha-aura test class overview
const helper = require('aura/FormFields/FormFieldsHelper');
@isTest
class FormFieldsController {
@runBefore
before() {
global.$A = auraFactory();
this.sandbox = sinon.sandbox.create();
global.document = {getElementById: () => {} }
}
@yury-sannikov
yury-sannikov / ec2-spot-cluster.template.yaml
Created September 10, 2017 18:01
EC2 Spot Instances Launch Configuration and Autoscaling Group for GPU ECS Cluster
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates environment for running GPU workload on EC2 Container Service
Parameters:
ECSInstanceType:
AllowedValues: [g2.2xlarge, g2.8xlarge, p2.xlarge, p2.8xlarge, p2.16xlarge]
ConstraintDescription: Must be g2.2xlarge, g2.8xlarge, p2.xlarge, p2.8xlarge,
p2.16xlarge
Default: g2.2xlarge
Description: ECS instance type
Type: String
@yury-sannikov
yury-sannikov / gpu-docker-task-definition.json
Created September 9, 2017 18:43
GPU Docker Task Definition
{
"taskDefinition": {
"status": "ACTIVE",
"networkMode": "bridge",
"family": "gpu-docker",
"placementConstraints": [],
"volumes": [],
"taskDefinitionArn": "arn:aws:ecs:us-east-1:217509956792:task-definition/ethminer-docker:1",
"containerDefinitions": [
{
@yury-sannikov
yury-sannikov / ethereum-vpc.template
Created September 6, 2017 23:59
Ethereum Virtual Private Cloud Template for Amazon CloudFormation
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Ethereum Cluster VPC with two availability zones'
Metadata:
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
default: 'VPC Parameters'
Parameters:
- ClassB
@yury-sannikov
yury-sannikov / Dockerfile
Created September 2, 2017 18:12
GPU Docker
FROM nvidia/cuda:8.0-cudnn7-devel
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get -y install \
kmod \
make \
build-essential \
cmake \
cpp \
g++ \
// inputFieldAdapter.js
const sinon = require('sinon');
exports.inputFieldAdapter = function inputFieldAdapter(componentInstance, params = {}) {
const setParam = (cmp, name, value) => cmp.params[name] = params.hasOwnProperty(name) ? params[name] : value;
// Set default property values on a component instance
setParam(componentInstance, 'label', '');
setParam(componentInstance, 'fieldType', '');
...
// Add component-specific methods on component instance