This file contains 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
import sublime | |
import sublime_plugin | |
class ChangeViewFontSizeCommand(sublime_plugin.TextCommand): | |
def run(self, edit, by): | |
settings = self.view.settings() | |
settings.set("font_size", settings.get("font_size") + by) |
This file contains 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
Show hidden characters
// These shortcuts go easy on your wrists if you remap CAPS -> Ctrl. | |
[ | |
{ | |
"keys": ["ctrl+j"], | |
"command": "move", "args": {"by": "lines", "forward": true} | |
}, | |
{ | |
"keys": ["ctrl+k"], | |
"command": "move", "args": {"by": "lines", "forward": false} | |
}, |
This file contains 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 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
// These shortcuts go easy on your wrists if you remap CAPS -> Ctrl. | |
[ | |
{ "keys": [",", "/"], | |
"context": [ | |
{ "key": "setting.command_mode", "operand": true }, | |
{ "key": "setting.is_widget", "operand": false } | |
], | |
"command": "run_macro_file", | |
"args": { | |
"file": "Packages/User/comment-and-move-to-the-next-line.sublime-macro"} |
This file contains 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 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 HashTable | |
class Slot | |
attr_accessor :key, :value, :vacated | |
def initialize key, value | |
self.key = key | |
self.value = value | |
self.vacated = true | |
end | |
This file contains 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
#!/bin/bash | |
function frequently_changed_files { | |
git log --name-only --pretty=format: | sort | uniq -c | sort -nr | |
} | |
# Find classes names on a given file. | |
function find_classes { | |
filename=$1 | |
# Possible matches: |
This file contains 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
execute pathogen#infect() | |
syntax on | |
syntax enable | |
filetype plugin indent on | |
colorscheme monokai_pro | |
set cursorline | |
highlight CursorLine ctermbg=333333 |
This file contains 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
#!/bin/bash | |
# Converts camelCased words into snake_cased ones. | |
# (This might be seful when you have to convert a JS object into an Elixir one.) | |
# TODO: Ignore quoted strings. | |
function camel_to_snake_case { | |
while read -r line; do | |
echo $line | sed 's/\(.\)\([A-Z]\)/\1_\2/g' | tr '[:upper:]' '[:lower:]' | |
done | |
} |
This file contains 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
{ | |
// http://www.sublimetext.com/docs/3/themes.html | |
"variables": { | |
"quick_panel_path_label_color":"#222", | |
"quick_panel_matched_label_color": "#022FDF", | |
"quick_panel_matched_path_label_color":"#111", | |
"quick_panel_selected_path_label_color": "#222", | |
"quick_panel_selected_matched_label_color": "#022FDF", |
NewerOlder