Skip to content

Instantly share code, notes, and snippets.

@alextretyak
alextretyak / commands.py
Last active October 6, 2017 11:42
Moved to https://github.com/alextretyak/scripts_of_mine_for_sublime (so this gist is not updated anymore).
import sublime, sublime_plugin, os, re, sys, binascii, urllib, subprocess, calendar, time, copy, unicodedata, inspect
#ИЗ http://stackoverflow.com/questions/11879481/can-i-add-date-time-for-sublime-snippet
import datetime, getpass
class AddDateTimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet", { "contents": datetime.datetime.now().strftime("%Y.%m.%d %H:%M:%S") })#({# БЫЛО: "("+str(int(time.time()))+"±X)" } )
#self.view.run_command("insert_snippet", { "contents": "("+str(int(time.time()))+"±?)" })
class AddEndDateTimeCommand(sublime_plugin.TextCommand):
def run(self, edit):