Skip to content

Instantly share code, notes, and snippets.

@kirillgashkov
kirillgashkov / Swift.sublime-build
Created March 25, 2018 21:54
Sublime Text 3 Build System for Swift
{
"selector": "source.swift",
"shell_cmd": "swift $file",
"variants": [
{
"name": "Executable",
"shell_cmd": "swiftc $file -o $file_base_name"
}
]
}
@kirillgashkov
kirillgashkov / AppleScript.sublime-build
Created March 25, 2018 21:56
Sublime Text 3 Build System for AppleScript
{
"selector": "source.applescript",
"shell_cmd": "osacompile $file",
"variants": [
{
"name": "Run",
"shell_cmd": "osascript $file"
},
{
"name": "Application",
@kirillgashkov
kirillgashkov / swift-exception-types.md
Created June 11, 2018 18:53
A list of common Swift exception types.

Swift Exception Types

A list of common Swift exception types.

EXC_BAD_ACCESS; SIGSEGV; SIGBUS

Bad Memory Access.

The process attempted to access invalid memory, or it attempted to access memory in a manner not allowed by the memory's protection level (e.g. writing to read-only memory).

@kirillgashkov
kirillgashkov / README.md
Last active January 21, 2019 18:34
Sublime Text 3 command that creates a new file inheriting the syntax of the active one.

Installation

Manual

  1. Put SugaryNewFileCommand.py under Packages/User
  2. Add new key binding { "keys": ["super+n"], "command": "sugary_new_file" }
  3. Done.
@kirillgashkov
kirillgashkov / sort_worksheet.py
Last active September 29, 2019 12:07
Sorts a gspread worksheet using given sort orders.
# Copyright (c) 2019 Kirill Gashkov
import gspread
import gspread.utils
def sort_worksheet(wks, *specs, range=None):
"""Sorts a gspread worksheet using given sort orders.
:param wks: The worksheet to sort.
@kirillgashkov
kirillgashkov / update_notes_on_worksheet_cells.py
Last active September 29, 2019 13:02
Updates many notes on worksheet cells at once.
# Copyright (c) 2019 Kirill Gashkov
import gspread
import gspread.utils
from collections import defaultdict
from itertools import chain
def update_notes_on_worksheet_cells(wks, note_cell_list):