Skip to content

Instantly share code, notes, and snippets.

View mythical-programmer's full-sized avatar

Mythical Programmer mythical-programmer

View GitHub Profile
@mythical-programmer
mythical-programmer / Preferences.sublime-settings
Last active August 26, 2015 20:07
sublime: settings user
{
// for better completions
"auto_complete_triggers":
[
{
"characters": "qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJMIKOLP",
"selector": "text, source, meta, string, punctuation, constant"
}
],
// display, look and feel
@mythical-programmer
mythical-programmer / Default (Linux).sublime-keymap
Last active August 30, 2015 16:29
sublime: keybindings keyboard shortcuts user
[
{ "keys": ["ctrl+w"], "command": "pass" },
{ "keys": ["ctrl+shift+w"], "command": "close" },
// default: ctrl+e zen coding expansion a.link<ctrl+e> gives <a class="link"></a>
// duplicate and delete line
{ "keys": ["ctrl+d"], "command": "duplicate_line" },
// sorry crtl+k is used for multiple stuffs
{ "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
@mythical-programmer
mythical-programmer / Package Control.sublime-settings
Last active August 26, 2015 20:16
sublime: package control settings user
{
"in_process_packages":
[
],
"installed_packages":
[
"Anaconda",
"Better Completion",
"Chain of Command",
"DictionaryAutoComplete",
@mythical-programmer
mythical-programmer / sbc-api-my-python.sublime-settings
Last active September 20, 2015 09:43
python: better completions
{
// coding genie
"scope": "source.python - string",
"completions":
[
////////////////////////////////////////////////////////////////////////
////////////////////// BEGIN ///////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
["a arr ___", "a[$1]$2"],
@mythical-programmer
mythical-programmer / reg_replace.sublime-settings
Last active August 26, 2015 20:08
sublime: RegReplace commands, settings user
{
"replacements": {
"newlines_to_escaped_newline_chars": {
"find": "\n",
"replace": "\\\\n",
"greedy": true,
"case": false
},
"tabs_to_escaped_tab_chars": {
"find": "\t",
@mythical-programmer
mythical-programmer / sbc-setting.sublime-settings
Created August 26, 2015 20:15
package: better completions: settings user
{
// --------------------
// sublime-better-completions-Package (sbc package)
// --------------------
// API files is contains the *keyword* such as `html`, `jquery`, `myglossary` with lowercase as filename `sbc-api-${filename}.sublime-settings` place in `/packages/User/` (your own) or `/packages/${this-package}/sublime-completions/` (package build-in).
// After you enable, disable or added new your own completions, you might need restart your Sublime Text Editor.
//
// Your own setting file `sbc-setting.sublime-settings` need to place in `/packages/User/` and contains all your api setting property that you want to enable.
//
// --------------------
@mythical-programmer
mythical-programmer / PlainTasks.sublime-settings
Last active August 28, 2015 06:38
sublime: PlainTasks settings user
{
"open_tasks_bullet": "☐", // options: - | ❍ | ❑ | ■ | □ | ☐ | ▪ | ▫ | – | — ≡ → › | [ ]
"done_tasks_bullet": "✔", // options: + | ✓ | ✔ | √ | [x]
"cancelled_tasks_bullet": "✘", // options: x | ✘ | [-]
"before_tasks_bullet_margin": 1,
"date_format": "(%y-%m-%d %H:%M)",
"done_tag": true, // related to @cancelled as well
"project_tag": true, // if true - postfix archived task with project tag, if false - prefix
"archive_name": "Archive:", // make sure it is the unique project name within your todo files
"new_on_top": true, // how to sort archived tasks
@mythical-programmer
mythical-programmer / sbc-api-my-javascript.sublime-settings
Last active August 31, 2015 04:08
javascript: better completions autocompletes
{
"scope": "source.js - string, source.coffee, source.js.embedded.html",
// ## source
// * http://overapi.com/javascript/
// * http://www.w3schools.com/js/
"completions":
[
////////////////////////////////////////////////////////////////////////////////
////////////////////////////// start ///////////////////////////////////////////
@mythical-programmer
mythical-programmer / sbc-api-my-html.sublime-settings
Created August 31, 2015 03:54
html: sublime completions autocompletes
{
"scope": "text.html - source - meta.tag, punctuation.definition.tag.begin",
"completions":
[
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
["html ___", "<!DOCTYPE html>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>$1</title>\n</head>\n<body>\n\t\n</body>\n</html>"],
["doctype ___", "<!DOCTYPE html>"],
["details_expand ___", "<details>\n\t<summary>\n\t</summary>\n\t<p></p>\n</details>"],
# union find data structure
# general for any key (not just integer elements)
# $ py uf.py in/tinyUF.txt
import sys
from collections import defaultdict
# weighted union-find data structure with path compression
class UF:
def __init__(self):
self._sz = defaultdict(int)