Skip to content

Instantly share code, notes, and snippets.

@pyrochlore
pyrochlore / export-google-docs-to-restructured-text.js
Created September 21, 2017 10:04 — forked from simonw/export-google-docs-to-restructured-text.js
Google Apps script to convert a Google Docs document into reStructuredText
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Convert to .RST')
.addItem('Convert to .RST and email me the result', 'ConvertToRestructuredText')
.addToUi();
}
// Adopted from https://github.com/mangini/gdocs2md by Renato Mangini
// License: Apache License Version 2.0
String.prototype.repeat = String.prototype.repeat || function(num) {
@pyrochlore
pyrochlore / export-google-docs-to-restructured-text.js
Created September 21, 2017 10:04 — forked from simonw/export-google-docs-to-restructured-text.js
Google Apps script to convert a Google Docs document into reStructuredText
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Convert to .RST')
.addItem('Convert to .RST and email me the result', 'ConvertToRestructuredText')
.addToUi();
}
// Adopted from https://github.com/mangini/gdocs2md by Renato Mangini
// License: Apache License Version 2.0
String.prototype.repeat = String.prototype.repeat || function(num) {
@pyrochlore
pyrochlore / dispatch.py
Created January 29, 2017 14:17 — forked from aortbals/dispatch.py
Synchronize two folders using python.
#! /usr/bin/python
# Dispatch - synchronize two folders
import os
import filecmp
import shutil
from stat import *
class Dispatch:
''' This class represents a synchronization object '''
import sublime, sublime_plugin
import os.path, string
VALID_FILENAME_CHARS = "-_.() %s%s%s" % (string.ascii_letters, string.digits, "/:\\")
# { "keys": ["alt+o"], "command": "open_filename_under_cursor" }
# https://gist.github.com/1186126
class OpenFilenameUnderCursor(sublime_plugin.TextCommand):
def run(self, edit):
for region in self.view.sel():