Skip to content

Instantly share code, notes, and snippets.

@avtehnik
avtehnik / client.ts
Created October 16, 2023 08:10
node js ts vendure client example to createAssets
import crossFetch from 'cross-fetch';
import * as FormData from 'form-data';
import * as fs from "fs";
const formData = new FormData();
formData.append(
'operations',
JSON.stringify({
@avtehnik
avtehnik / pdolog.php
Last active January 26, 2021 13:44
pdo log
<?php
class PDOLog extends PDO{
public $queriesLog = [];
public $transactionCounter = 0;
public function prepare(){
$arg_list = func_get_args();
$this->queriesLog[] = $arg_list[0];
{
"data": [
{
"id": 1,
"parent_id": null,
"name": "root",
"desc": "",
"descat": "",
"listcat": "",
"ad_active": false,
{
"data": [
{
"id": 1,
"parent_id": null,
"name": "root",
"desc": "",
"descat": "",
"listcat": "",
"ad_active": false,
@avtehnik
avtehnik / package.json
Created October 23, 2019 23:52
node udp echo server
{
"name": "service-discovery",
"version": "1.0.0",
"description": "",
"main": "udp-server.js",
"dependencies": {
"broadcast-address": "^1.0.2",
"dgram": "^1.0.1",
"dotenv": "^8.2.0"
},
@avtehnik
avtehnik / receiver.js
Created September 19, 2019 21:43
socketcan sender receiver
var can = require('socketcan');
var channel = can.createRawChannel("can0", true);
channel.addListener("onMessage", function(msg) {
console.log(msg.data.toString());
});
channel.start();
@avtehnik
avtehnik / UdpDebugger.php
Last active February 7, 2020 11:08
php udp debugger
<?php
class UdpDebugger
{
private static $sock;
private static $id;
public static function Debug()
{
var Web3 = require('web3');
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
var balance = 0;
web3.eth.getBalance('0xfb71B55C0C526638e1d6b3DA7598a1b3785d30f8', function(err, wei) {
balance = web3.utils.fromWei(wei, 'ether')
console.log(balance);
});
@avtehnik
avtehnik / genesis.json
Last active December 13, 2018 08:11
private etherium network
{
"config": {
"chainId": 33,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000033",
"timestamp": "0x0",
@avtehnik
avtehnik / can dump.txt
Created June 19, 2018 10:07
Ford Fiesta mk6 2006 cand dump start engine stop engine
This file has been truncated, but you can view the full file.
can0 430 [7] 14 01 90 FF C0 00 20
can0 430 [7] 14 01 90 FF C0 00 20
can0 433 [8] 80 10 00 00 00 20 00 00
can0 430 [7] 14 01 90 FF C0 00 20
can0 430 [7] 14 01 90 FF C0 00 20
can0 430 [7] 14 01 90 FF C0 00 20
can0 210 [7] FF FF 30 68 90 00 01
can0 4B0 [8] 27 10 27 10 27 10 27 10
can0 210 [7] FF FF 30 68 90 00 02
can0 4B0 [8] 27 10 27 10 27 10 27 10