Skip to content

Instantly share code, notes, and snippets.

Aleksey Ivanov ivanovaleksey

Block or report user

Report or block ivanovaleksey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View schema.sql
drop extension "uuid-ossp" cascade;
create extension "uuid-ossp";
drop type abac_attribute cascade;
create type abac_attribute as (
value text,
key text,
namespace_id uuid
);
@ivanovaleksey
ivanovaleksey / error-chain.rs
Last active Dec 5, 2018
Migrate from error-chain to failure
View error-chain.rs
error_chain! {
foreign_links {
Diesel(::diesel::result::Error);
Json(::serde_json::Error);
Mqtt(::rumqtt::Error);
Utf8(::std::string::FromUtf8Error);
Uuid(::uuid::ParseError);
}
errors {
@ivanovaleksey
ivanovaleksey / seeds.sql
Last active Apr 3, 2018
signals-rs seeds
View seeds.sql
-- table room
DELETE FROM room;
INSERT INTO room (id)
SELECT uuid_generate_v4()
FROM
generate_series(1, 3);
-- table room
@ivanovaleksey
ivanovaleksey / room_agent.rs
Last active Mar 19, 2018
Enum with integer in DB
View room_agent.rs
use uuid::Uuid;
use models::{Agent, Room};
use schema::room_agent;
#[derive(Associations, Queryable, Debug)]
#[table_name = "room_agent"]
#[belongs_to(Agent)]
#[belongs_to(Room)]
pub struct RoomAgent {
View main.rs
extern crate gtk;
use gtk::*;
fn main() {
if gtk::init().is_err() {
eprintln!("failed to initialize GTK Application");
std::process::exit(1);
}
let window = Window::new(WindowType::Toplevel);
@ivanovaleksey
ivanovaleksey / videoroom.md
Created Dec 14, 2017
Describe videoroom plugin flow
View videoroom.md
  1. OUT: Join
{request: "join", room: 1234, ptype: "publisher", display: "a"}

Создается participant (с типом publisher) и добавляется в комнату.

g_hash_table_insert(videoroom->participants, janus_uint64_dup(publisher->user_id), publisher);
@ivanovaleksey
ivanovaleksey / out.sh
Created Dec 7, 2017
FFmpeg: RTP - MP4
View out.sh
#!/bin/bash
ffmpeg \
-protocol_whitelist file,udp,rtp -i sdp.test \
-c:v libx264 -c:a aac \
-y test.mp4
# ffmpeg \
# -protocol_whitelist file,rtp,udp -i sdp.test \
View dry_markup.rb
require 'dry-struct'
module Types
include Dry::Types.module
end
class Button < Dry::Struct
attribute :text, Types::String
end
@ivanovaleksey
ivanovaleksey / The Technical Interview Cheat Sheet.md
Created Mar 4, 2017 — forked from TSiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@ivanovaleksey
ivanovaleksey / iterm2-solarized.md
Created Mar 2, 2017 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel9k

Powerlevel9k

You can’t perform that action at this time.