Skip to content

Instantly share code, notes, and snippets.

View naveenspace7's full-sized avatar
Shooting for stars

Naveen Chakravarthy naveenspace7

Shooting for stars
View GitHub Profile
@naveenspace7
naveenspace7 / settings.json
Created April 21, 2023 13:56
Super-dark theme in VS Code
{
"workbench.colorTheme": "Ayu Dark",
"workbench.colorCustomizations": {
"activityBar.foreground": "#fdfdfd",
"activityBar.background": "#000000",
"editor.background": "#000000",
"sideBar.background": "#000000",
"minimap.background": "#000000",
"statusBar.foreground": "#ffffff"
},
@naveenspace7
naveenspace7 / async_wait_demo.cpp
Created August 17, 2020 09:24
Boost asio code snippets
// g++ async_wait_demo.cpp -o out -lboost_system -lpthread -lboost_thread
#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
using namespace std;
void work_for_io_service_5( const boost::system::error_code& e)
{
#include <iostream>
#include <vector>
#include <algorithm>
#include <sys/ipc.h>
#include <sys/shm.h>
using namespace std;
void * shared_mem;
#include <vector>
void * mem_pool_ptr;
template<typename type>
struct MyAlloc : allocator<type>
{
type* allocate(size_t size)
{
cout << "Allocate function called with size " << size << endl;
@naveenspace7
naveenspace7 / priority_queue_demo.cpp
Created June 26, 2020 05:52
This is a small demo showing the usage of priority queues and standalone heap
#include <iostream>
#include <queue>
#include <vector>
#include <functional>
#include <algorithm>
using namespace std;
class Compare {
public:
@naveenspace7
naveenspace7 / unordered_set_demo.cpp
Last active June 22, 2020 18:54
This is a small demo showing how to properly use std::unordered_set in C++
/*
* std::unordered_set unlike a std::set is implementation of chaining hash table.
* Therefore, it requires additional implementation to get it to work.
* This demo tries to show the requirements for such an implementation.
*/
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <functional>

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close