Skip to content

Instantly share code, notes, and snippets.

View tmacam's full-sized avatar

Tiago Alves Macambira tmacam

View GitHub Profile
# -*- coding: utf-8 -*-
from datetime import datetime
import time
import sublime_plugin
class TimestampCommand(sublime_plugin.EventListener):
"""Expand `isoD`, `now`, `datetime`, `utcnow`, `utcdatetime`,
`date` and `time`
@tmacam
tmacam / README.md
Created July 20, 2022 17:12 — forked from tpitale/README.md
Sublime Text plugin to create a simple timestamp
  1. Go to Tools > New Plugin
  2. Paste timestamp.py contents and save in User as timestamp.py
  3. Open Preferences > Key Bindings - User (or Default, your call)
  4. Paste keybindings.json, or add a line to your keybindings
  5. Customize the keyboard shortcut to your liking and save
@tmacam
tmacam / .vimrc
Created December 16, 2013 12:26 — forked from flaviotruzzi/.vimrc
" Sample .vimrc file by Martin Brochhaus
" Presented at PyCon APAC 2012
" ============================================
" Note to myself:
" DO NOT USE <C-z> FOR SAVING WHEN PRESENTING!
" ============================================
#ifndef PRODUCER_CONSUMER_QUEUE_HPP_
#define PRODUCER_CONSUMER_QUEUE_HPP_
// Based on code from http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html
// Original version by Anthony Williams
// Modifications by Michael Anderson -- https://gist.github.com/482342
#include <boost/thread.hpp>
;; joins two consecutives lines like vim's "J"
(defun join-lines ()
(interactive)
(save-excursion
(end-of-line)
(insert-char ? 1)
(delete-char 1)
(while (looking-at "\\s +")
(delete-char 1))))