Skip to content

Instantly share code, notes, and snippets.

View kvasdopil's full-sized avatar

Alexey Guskov kvasdopil

  • Ombori
  • Stockholm, Sweden
View GitHub Profile
@kvasdopil
kvasdopil / claw.js
Last active November 20, 2023 16:51
servo pid control for robot claw
console.log(123);
let i = 0;
/*setInterval(() => {
analogWrite(D2, i, {freq: 50});
console.log(i);
i+=0.1;
if (i > 1) i = 0;
}, 500);*/
@kvasdopil
kvasdopil / main.js
Created October 25, 2023 10:14
Report accelerometer value of minew beacon
digitalPulse(LED1, true, 200);
I2C1.setup({sda: D12, scl: D11});
const acc = require("LIS3DH").connectI2C(I2C1);
function ypl(a) {
const x = a.x;
const y = a.y;
const z = a.z;
@kvasdopil
kvasdopil / gl_image_processor_backend.cc
Created April 15, 2023 06:20
GL ImageProcessor for chromium
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/chromeos/gl_image_processor_backend.h"
#include "base/functional/callback_forward.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/synchronization/waitable_event.h"
<body style="padding:0;margin:0">
<div>
<video id="a" src="red.mp4"
style="height:100vh" autoplay></video>
<video id="b" src="gron.mp4"
style="height:100vh;display:none"></video>
</div>
<script>
const v1 = document.querySelector('#a');
const v2 = document.querySelector('#b');
<video src="red.mp4" autoplay loop />
<div>
<video id="a" src="red.mp4" style="width:300px" autoplay></video>
<video id="b" src="gron.mp4" style="width:300px"></video>
</div>
<button id="btn">play</button>
<script>
const v1 = document.querySelector('#a');
const v2 = document.querySelector('#b');
document.querySelector('#btn').onclick = () => v1.play();
<#PSScriptInfo
.VERSION 1.3
.GUID ebf446a3-3362-4774-83c0-b7299410b63f
.AUTHOR Michael Niehaus
.COMPANYNAME Microsoft
@kvasdopil
kvasdopil / install-everything.sh
Last active November 29, 2018 17:01
My script to quickly bootstrap my osx workstation
#!/bin/sh
# === BASIC SETUP ===
# installing homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask # enable installing osx software via brew
brew tap caskroom/versions # enable versions (to install older jdk, not sure if necessary)
brew tap homebrew/cask-fonts # enable font installing
export default class BtnGroup extends React.Component {
state = {
active: null
};
onClick = (id) => {
this.setState({ active: id });
}
render() {
@kvasdopil
kvasdopil / server.js
Last active July 16, 2018 14:40 — forked from tuor4eg/server.js
const readFileAsync = file => new Promise((resolve, reject) => {
fs.readFile(file, (err, data) => err ? reject(err) : resolve(data));
});
const records = async (req, res) => {
await readFileAsync('phonebook.txt');
const count = readBook.toString().split('\n').length - 1;
const str = `Welcome to The Phonebook\nRecords count: ${count}`;
res.write(str);
};