This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Vim stuff. | |
"vintage_start_in_command_mode": true, | |
"vintage_ctrl_keys": true, | |
"added_words": [], | |
"caret_style": "smooth", | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"use_tab_stops": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// All of this sortcuts are ergonomic if you remap | |
// CAPS -> Ctrl | |
// Right Opt -> Esc | |
//(I use Karabiner-Elements for that.) | |
[ | |
{ "keys": [",", "/"], | |
"context": [ | |
{ "key": "setting.command_mode", "operand": true }, | |
{ "key": "setting.is_widget", "operand": false } | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hi clear | |
if &t_Co > 255 | |
" hi Normal ctermbg=234 | |
hi CursorLine ctermbg=235 cterm=none | |
hi CursorLineNr ctermfg=208 cterm=none | |
hi Boolean ctermfg=135 | |
hi Character ctermfg=144 | |
hi Number ctermfg=135 | |
hi String ctermfg=156 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dirent.h> | |
#include <pwd.h> | |
#include <grp.h> | |
#include <time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "./linked_list.rb" | |
class LinkedList | |
# Reuses list nodes from the specified node | |
# to the end of the list. | |
# The complexity of this method is O(n) where n | |
# is the distance from the target node to the | |
# end of the list. | |
def reuse_from_node node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "./linked_list.rb" | |
require_relative "./set.rb" | |
# Here we monkey patched LinkedList to add a method | |
# that allows us to remove vertices in constant time. | |
class LinkedList | |
# Removes the node that is right next | |
# to the specified node. | |
# Complexity O(1). | |
def remove_next prev_node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AVLTree | |
# Represents an entry into the avl tree. | |
class Node | |
attr_accessor :key, :data, :height, :left, :right, :deleted | |
def initialize key, data | |
self.key = key | |
self.data = data | |
self.height = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BTree | |
attr_accessor :root, :size | |
class Node | |
attr_accessor :parent, :data, :left, :right | |
def initialize parent, data | |
self.parent = parent | |
self.data = data | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "./linked_list.rb" | |
class Set | |
# Set's constructor. | |
def initialize | |
@list = LinkedList.new | |
end | |
# Inserts a member into the current set. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stack | |
class Node | |
attr_accessor :next, :data | |
def initialize data | |
self.data = data | |
self.next = nil | |
end | |
end | |
attr_accessor :head, :tail, :length |