Skip to content

Instantly share code, notes, and snippets.

View maksimkurb's full-sized avatar

Maxim Kurbatov maksimkurb

View GitHub Profile
@maksimkurb
maksimkurb / Fire2022.h
Last active December 13, 2024 09:46
Gyver Fire 2019 effect for WLED
#pragma once
#include "wled.h"
#include "FX.h"
#define USERMOD_ID_FIRE_2022 55
//these values are substracetd from the generated values to give a shape to the animation
const unsigned char valueMask[8][16] PROGMEM = {
{32 , 0 , 0 , 0 , 0 , 0 , 0 , 32 , 32 , 0 , 0 , 0 , 0 , 0 , 0 , 32 },
{64 , 0 , 0 , 0 , 0 , 0 , 0 , 64 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 64 },
@maksimkurb
maksimkurb / Next Audio Device.ps1
Created November 15, 2023 16:31
Next Audio Device
# Toggle Audio Devices script
# 1. Install this modules before using this script:
# > Install-Module -Name AudioDeviceCmdlets
#
# 2. Add shortcut with the following target:
# C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive -WindowStyle hidden -NoLogo -ExecutionPolicy Bypass -File "C:\Users\max\Documents\NextAudioDevice.ps1"
#
# 3. Add this shortcut to your start menu and to Taskbar
# Start menu location: %appData%\Microsoft\Windows\Start Menu
#
@maksimkurb
maksimkurb / command.txt
Created September 27, 2022 20:37 — forked from fbn4sc/command.txt
Delete all branches except master and develop.
git branch | grep -v "master\|develop" | xargs git branch -D
@maksimkurb
maksimkurb / snippet.js
Created July 29, 2019 19:45
rasp.sstu.ru parser to iCal format
// Open schedule page and paste this script into the console
// After, copy result and save to .ical file
/*! ics.js Wed Sept 14 2017 */
var ics=function(e,t){"use strict";{if(!(navigator.userAgent.indexOf("MSIE")>-1&&-1==navigator.userAgent.indexOf("MSIE 10"))){void 0===e&&(e="default"),void 0===t&&(t="Calendar");var r=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",n=[],i=["BEGIN:VCALENDAR","PRODID:"+t,"VERSION:2.0"].join(r),o=r+"END:VCALENDAR",a=["SU","MO","TU","WE","TH","FR","SA"];return{events:function(){return n},calendar:function(){return i+r+n.join(r)+o},addEvent:function(t,i,o,l,u,s){if(void 0===t||void 0===i||void 0===o||void 0===l||void 0===u)return!1;if(s&&!s.rrule){if("YEARLY"!==s.freq&&"MONTHLY"!==s.freq&&"WEEKLY"!==s.freq&&"DAILY"!==s.freq)throw"Recurrence rrule frequency must be provided and be one of the following: 'YEARLY', 'MONTHLY', 'WEEKLY', or 'DAILY'";if(s.until&&isNaN(Date.parse(s.until)))throw"Recurrence rrule 'until' must be a valid date string";if(s.interval&&isNaN(parseInt(s.i
@maksimkurb
maksimkurb / graphql-validation.pipe.ts
Created May 10, 2019 13:23
GraphqlValidationPipe
/**
(The MIT License)
Copyright (c) 2017-2019 Kamil Myśliwiec <http://kamilmysliwiec.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@maksimkurb
maksimkurb / index.js
Created August 11, 2018 20:52
Vk hide all friends
function adder(user,list,add,st) {
var o = user;
o[6] = parseInt(o[6]);
add ? (o[6] & 1 << list || (o[6] += 1 << list)) : (o[6] & 1 << list && (o[6] -= 1 << list));
setTimeout(function () {
ajax.post("al_friends.php", {
act: "save_cats",
@maksimkurb
maksimkurb / readme.md
Last active August 1, 2018 20:22
WSL for Node.JS, VSCode, direnv, wslgit.exe proper working

Prepare

sudo apt update
sudo apt install git zsh python build-essential direnv

### Installing antigen
curl -L git.io/antigen > .antigen.sh

### Installing asdf

Keybase proof

I hereby claim:

  • I am maksimkurb on github.
  • I am maksimkurb (https://keybase.io/maksimkurb) on keybase.
  • I have a public key ASAUzmazfa8atw_jFayC9OI1LJ3gjOJE_jf99Zl4PZDhwQo

To claim this, I am signing this object:

@maksimkurb
maksimkurb / User.js
Last active November 27, 2016 10:00
react-starter-kit passportjs fb
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import Bookshelf from '../bookshelf';
@maksimkurb
maksimkurb / BlockStorage.cpp
Last active August 29, 2015 14:08
BlockStorage
/**
* C++ version of ExtendedBlockStorage
* This storage can store 16x16x16 blocks. Every block can have ID from 0 to 4095 (LSB array store 0..255 per xyz coord pair and MSB array store 0..15 per xyz coord pair, then this numbers merging (row 29) )
* blockMetadataArray contains int 0..15 per xyz coord pair. In Minecraft it using like block subid, for example 5:3, where 5 - wood plank id and 3 - it color
*/
BlockStorage::BlockStorage(int y)
{
this->y = y;
blockLSBArray = new char[4096];