Skip to content

Instantly share code, notes, and snippets.

View georgyangelov's full-sized avatar

Georgy Angelov georgyangelov

View GitHub Profile
@georgyangelov
georgyangelov / KeyboardController.h
Last active September 9, 2019 13:55
C++ wrapper class for working with the Creative Aurora LED SDK (for the SoundBlasterX Vanguard K08 keyboard)
#pragma once
#include <initguid.h>
#include <windows.h>
#include <vector>
#include "../sdk/Include/ICTLEDMgr.h"
#include "../sdk/Include/CLSID_CCTLEDMgr.h"
#include "../sdk/Include/CTIntrfc_DynamicLoad.h"
#include "../sdk/Include/CTLEDCommon.h"
@georgyangelov
georgyangelov / README.md
Last active November 11, 2017 16:25
Rust homework 2 polynomial visualizer

Рисувач на полиноми

https://fmi.rust-lang.bg/tasks/3

Инструкции

  1. Копирайте main.rs в проекта.
  2. Сменете импортите.
  3. Дефинирайте метод pub fn apply(&self, x: f64) -> f64 в Polynomial.
  4. Сложете lodepng към зависимостите в Cargo.toml.
@georgyangelov
georgyangelov / sort_like.rb
Created June 8, 2017 08:12
Sorts the beginning of a sequence like another sequence
module Enumerable
def sort_like(template)
sort_by.with_index do |element, index|
key = block_given? ? yield(element) : element
[template.index(key) || template.size + index + 1, key]
end
end
end
function parse(request)
local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP")
if not method then
_, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP")
end
local _GET = {}
if vars then
for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
_GET[k] = v
@georgyangelov
georgyangelov / rspec_formatter.rb
Created May 31, 2015 17:42
RSpec nested formatter
RSpec::Support.require_rspec_core 'formatters/base_text_formatter'
class RspecFormatter < RSpec::Core::Formatters::BaseTextFormatter
RSpec::Core::Formatters.register self, :start,
:stop,
:example_group_started,
:example_group_finished,
:example_passed,
:example_failed,
:example_pending
#!/usr/bin/env bash
apt-get -y update
# Install some tools
apt-get -y install git vim aspell
git config --global credential.helper 'cache --timeout=3600'
echo -e "\nexport EDITOR=vim\n" >> /home/vagrant/.bashrc
require 'v8'
V8::C::HandleScope() do
template = V8::C::ObjectTemplate.New()
context = V8::C::Context.New(nil, template)
context.Enter
p V8::C::Object.New()
end
@georgyangelov
georgyangelov / cypher_sample.cql
Last active August 29, 2015 14:13
Sample Neo4j/Cypher queries
create
(p1:Person {name: 'Бригадир Цветков', age: 24, gender: 'm'}),
(p2:Person {name: 'Букетка Градинарова', age: 26, gender: 'f'}),
(p3:Person {name: 'Вовеки Веков Иванов', age: 25, gender: 'm'}),
(p4:Person {name: 'Гъдьо Гъдев', age: 22, gender: 'm'}),
(p5:Person {name: 'Дар Донков', age: 27, gender: 'm'}),
(p6:Person {name: 'Кирка Градинарска', age: 29, gender: 'f'}),
(p7:Person {name: 'Кучо Кучев', age: 30, gender: 'm'}),
(p8:Person {name: 'Лимон Генов', age: 50, gender: 'm'}),
(p9:Person {name: 'Марулка Митева', age: 19, gender: 'f'}),
data Bt a = Et | Ct a (Bt a) (Bt a)
instance Show a => Show (Bt a) where
show t = showTree 3 1 t
showTree :: (Show a) => Int -> Int -> Bt a -> String
showTree dx dy Et = ""
showTree dx dy (Ct root Et Et) = show root
showTree dx dy (Ct root left right) = centerRoot ++ "\n" ++ emptyLines dy ++ unlines subtreeLines
v=0
o=- 7518264307715983377 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS CCJALAcas2qVJgyxxWGmq2zKZNLF0XnQq2Gu
m=audio 39664 RTP/SAVPF 111 103 104 0 8 106 105 13 126
c=IN IP4 192.168.1.117
a=rtcp:1 IN IP4 0.0.0.0
a=candidate:319969617 1 udp 2113937151 192.168.1.117 39664 typ host generation 0