Skip to content

Instantly share code, notes, and snippets.

View LightVolk's full-sized avatar

Konstantin LightVolk

  • New-York
View GitHub Profile
@LightVolk
LightVolk / History\-16889434\entries.json
Last active April 13, 2023 12:30
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///c%3A/Users/simpl/AppData/Roaming/Code/Workspaces/1676218356565/workspace.json","entries":[{"id":"wfvS.json","timestamp":1676218492846}]}
@LightVolk
LightVolk / cloudSettings
Last active August 31, 2020 19:39
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-31T19:39:26.393Z","extensionVersion":"v3.4.3"}
@LightVolk
LightVolk / ioBroker.WeatherWatcher
Created April 16, 2019 16:53
Weather watcher writing by Sergey Makarov aka @freepooh (telegram)
createState('Climate.Weather.TodayText','');
var request = require('request');
getForecast();
function getForecast() {
request ('https://sinoptik.com.ru/%D0%BF%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0-%D1%81%D0%B0%D0%BC%D0%B0%D1%80%D0%B0-100499099', function (error, response, body) {
// get response
if (!error && response.statusCode == 200) {
// parse data
@LightVolk
LightVolk / InternetHelthCheck
Created April 4, 2019 17:20
Internet settings health checker (author Anzor)
//********************** Internet helthcheck ***************************
on({id: 'javascript.0.ext_ip', change: 'any'}, function (obj) {
if (obj.newState.val === "95.25.34.38") {
setState('javascript.0.extip_color',"green");
setState('javascript.0.extip_status',"/icons-mfd-svg//it_internet.svg");
}
else if (obj.newState.val != "95.25.34.38") {
////[In reply to aurodionov]
////////////////////////////Будильник//////////////////////////////////////////
on({time: "* * * * *"}, function () {
var otpusk = getState('javascript.0.Scenes.Otpusk').val;
if (!otpusk){
var date = new Date();
var day = date.getDay(); // 0-воскр. 6-суббота
var hour = date.getHours();
var min = (date.getMinutes()<10?'0':'') + date.getMinutes(); // если минута меньше 10, то добавляем 0
@LightVolk
LightVolk / door.ts
Last active January 26, 2020 18:26
IoBroker script: Main door script with Xiaomi door detector
var doorId="mihome.0.devices.some_id.state";
function SendToDevices(deviceId:string,message:string):void
{
sendTo(deviceId,message);
}
subscribe(doorId,function(obj)
{

Введение

  • Главный вопрос: что и зачем вы измеряете?
  • Используйте библиотеки для бенчмаркинга: JMH, BenchmarkDotNet

Как правильно запускать бенчмарк

  • Release build
  • Без дебаггера
  • Выключите другие приложения
@LightVolk
LightVolk / js-from-translate-post.js
Created July 27, 2015 16:29
js-from-translate-post
<web:VideoStreaming runat="server" ID="video" ClientIDMode="Static" Width="300px" Height="300px" Interval="100" Source="True" ScalingMode="TargetSize" StreamingMode="Target" TargetClientID="received" OnStreamed="onStreamed" Style="border: solid 1px black" />
public static Grammar MakeGrammar(String name,List<String> words)
{
Choices choises = new Choices();
GrammarBuilder gb = new GrammarBuilder();
gb.Culture = new CultureInfo("en-US");
if (choises == null)
throw new NullReferenceException("choises is null!");
if (words == null)
@LightVolk
LightVolk / unity_architecture_error
Created May 1, 2015 18:44
Unity:Found plugins with same names and architectures
IF you see error like this:
Found plugins with same names and architectures, Assets/Plugins/x86_64/OculusPlugin.dll () and Assets/Plugins/x86/OculusPlugin.dll (). Assign different architectures or delete the duplicate.
UnityEditor.AndroidPluginImporterExtension:CheckFileCollisions(String)
Plugins colliding with each other.
You need to go to Projets->Plugins - see the dll (name without dll) and double click on it.
So, select the platform that this plugin shoud be. For example- Standalone-x86. Then apply.