Skip to content

Instantly share code, notes, and snippets.

View ivelin's full-sized avatar
🎯
Focusing

Ivelin Ivanov ivelin

🎯
Focusing
View GitHub Profile
@ivelin
ivelin / gist:d3348ead68faf9707071bf9734616a94
Created August 21, 2019 21:33
frigate conf.yml example with ffmpeg parameters
################
# Optional ffmpeg input parameters. Change these only if you are experimenting with ffmpeg parameter optimization.
# Changing these parameters will override the default settings and may corrupt the video capture flow.
################
ffmpeg_input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- nobuffer
- -flags
@ivelin
ivelin / good_process_kill.py
Last active May 19, 2023 11:19
Python good process kill
def _process_kill(pid, signal=0):
"""Send a signal to a process.
:Returns:
----------
True if the pid is dead
with no signal argument, sends no signal.
"""
@ivelin
ivelin / mydapp
Created August 2, 2018 13:13
NYU Dapp
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@ivelin
ivelin / KaliDAOExtension.sol
Last active June 17, 2022 23:37
KaliDAO Extension
function setExtension(bytes calldata extensionData) external payable;
function callExtension(
address account,
uint256 amount,
bytes calldata extensionData
) external payable returns (bool mint, uint256 amountOut);
event ExtensionSet(address dao, bytes payload)
@ivelin
ivelin / gist:fcea7b9183f3b7e4fe9f8a4932348914
Created April 23, 2022 02:01
Sweat Token Budgeting Flow
sequenceDiagram
Project Manager->>DAO: propose(budget)
Note right of Project Manager: prepare and propose
Note right of Project Manager: key goals, budget and timeline
Members-->>DAO: approve(proposal)
Note right of Members: permit spending
Note right of Members: limited to budget and deadline
@ivelin
ivelin / orderBy.spec.js
Last active October 31, 2021 15:46
test orderBy support in fakeIndexeddb with empty secondary key value
/**
*
* Test orderBy support
*
*/
import Dexie from 'dexie'
/**
* LocalDatabase API for browser indexeddb objects
*/
@ivelin
ivelin / docker-compose.yaml
Last active June 10, 2020 18:18
Default docker compose configuration for Ambianic Edge
version: "3.7"
services:
ambianic-edge:
container_name: ambianic-edge
restart: unless-stopped
privileged: true
image: ambianic/ambianic-edge:latest
network_mode: "host"
volumes:
- /dev/bus/usb:/dev/bus/usb
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the Apache 2.0 license; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the Apache 2.0 license; or
@ivelin
ivelin / config.yaml
Last active March 5, 2020 16:12
Example config.yaml for a new Ambianic Edge install
######################################
# Ambianic main configuration file #
######################################
version: '1.2.4'
# path to the data directory
data_dir: &data_dir ./data
# Set logging level to one of DEBUG, INFO, WARNING, ERROR
logging:
dataset = pcap_io.PcapDataset(url_filenames, batch=1)
packets_total = 0
for v in dataset:
(packet_timestamp, packet_data) = v
if packets_total == 0:
assert packet_timestamp.numpy()[0] == 1084443427.311224 # we know this is the correct value in the test pcap file
assert len(packet_data.numpy()[0]) == 62 # we know this is the correct packet data buffer length in the test pcap file
packets_total += 1
assert packets_total == 43 # we know this is the correct number of packets in the test pcap file