Skip to content

Instantly share code, notes, and snippets.

View Splinter1984's full-sized avatar
:octocat:
SEE YOU SPACE SAMURAI

Andrianov Roman Splinter1984

:octocat:
SEE YOU SPACE SAMURAI
View GitHub Profile
"-----------------------"
" .vimrc
" author: @splinter1984
"-----------------------"
set number
syntax enable
set smarttab
set visualbell
set wildmenu
set ruler
@Splinter1984
Splinter1984 / master.vim
Created April 19, 2023 18:17 — forked from benjamincharity/master.vim
Master Vim with this interactive tutorial.
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
// schedule_read is called o start reading
void connection::connect()
{
boost::asio::ip::tcp::resolver resolver(_io);
boost::asio::ip::tcp::resolver::query query(_hostname, std::to_string(_port));
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query);
boost::system::error_code ec;
boost::asio::connect(_socket, iterator, ec);
if (ec)
/*
# Queue with minimum
Implement a queue that can also tell what is the current minimum. **The implementation must have O(1) complexity for all calls.**
*/
use std::collections::VecDeque;
pub struct MinQueue<T> {
val_stack: VecDeque<T>,
@Splinter1984
Splinter1984 / lib.rs
Last active February 7, 2022 06:50 — forked from Gadiguibou/lib.rs
Combinations in Rust
fn comb<T>(slice: &[T], k: usize) -> Vec<Vec<T>>
where
T: Copy,
{
//If k == 0, return a empty new vector
if k == 0 {
return vec![vec![]];
}
// If arr.is_empty(), return a empty new vector
if arr.is_empty() {
@Splinter1984
Splinter1984 / dynamic-urdf-publisher.py
Created January 10, 2022 18:01 — forked from guru-florida/dynamic-urdf-publisher.py
Monitor URDF file and dynamically update RViz2
#
# Dynamic URDF Publisher
#
# This script monitors a URDF file and when changed will publish to /robot_description
#
# Requirements:
# Besides the standard Ros2 modules, Install watchdog module for listening
# to filesystem events:
# `pip3 install watchdog`
#
Import-Module posh-git
function Write-BranchName () {
try {
$branch = git rev-parse --abbrev-ref HEAD
if ($branch -eq "HEAD") {
# we're probably in detached HEAD state, so print the SHA
$branch = git rev-parse --short HEAD
Write-Host " ($branch)" -NoNewline -ForegroundColor "red"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h\[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]$ "