Skip to content

Instantly share code, notes, and snippets.

View mykhailokrainik's full-sized avatar

Mykhailo Krainik mykhailokrainik

View GitHub Profile
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@mykhailokrainik
mykhailokrainik / gdbinit
Created July 21, 2019 07:33
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
@mykhailokrainik
mykhailokrainik / playground.rs
Created April 10, 2019 09:32 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(try_trait)]
enum InnerError {
NoneError,
}
trait CustomError: std::error::Error {
fn description(&self) -> &str;
fn cause(&self) -> Option<&std::error::Error> {
None
}
@mykhailokrainik
mykhailokrainik / https_multipart_upload.rs
Created November 1, 2018 15:04 — forked from veer66/https_multipart_upload.rs
Upload file as multipart via https in Rust
extern crate hyper;
extern crate multipart;
extern crate hyper_native_tls;
use hyper::Client;
use hyper::net::HttpsConnector;
use hyper_native_tls::NativeTlsClient;
use multipart::client::lazy::Multipart;
use std::io::Read;
@mykhailokrainik
mykhailokrainik / generators.rs
Last active November 1, 2018 12:33 — forked from rust-play/playground.rs
Rust Generators
#![allow(unused)]
#![feature(generators, generator_trait)]
use std::ops::{Generator, GeneratorState};
fn main() {
let mut generator = || {
yield 1;
return "foo"
};
@mykhailokrainik
mykhailokrainik / playground.rs
Last active September 13, 2018 07:46 — forked from rust-play/playground.rs
Rust shared structs.
trait Fruit {
fn who_am_i(&self) -> String;
}
struct Apple {
name: String,
}
struct Banana {
name: String,
@mykhailokrainik
mykhailokrainik / main.rs
Created July 7, 2018 11:55 — forked from patshaughnessy/main.rs
Execute a simple SQL report using Rust and Diesel
#[macro_use]
extern crate diesel;
use diesel::prelude::*;
table! {
users (id) {
id -> Int4,
first_name -> Nullable<Varchar>,
last_name -> Nullable<Varchar>,
@mykhailokrainik
mykhailokrainik / docker-compose-daemon.sh
Created September 19, 2017 19:57 — forked from domachine/docker-compose-daemon.sh
run docker-compose in daemon mode and attach to web container
docker-compose up -d
docker attach myapp_web_1
@mykhailokrainik
mykhailokrainik / gist:4d30b2ad9c19fd949a0bc3c6780fe52b
Created April 29, 2017 20:44 — forked from holms/gist:5005629
midnight commander dark color theme
Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this:
[Colors]
base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black