Skip to content

Instantly share code, notes, and snippets.

@haughki
haughki / insert_date_apps_script.js
Created November 13, 2020 19:55
A google apps script for google doc to a) create a new menu to insert the current date b) insert the date
/**
* The onOpen function runs automatically when the Google Docs document is
* opened. Use it to add custom menus to Google Docs that allow the user to run
* custom scripts. For more information, please consult the following two
* resources.
*
* Extending Google Docs developer guide:
* https://developers.google.com/apps-script/guides/docs
*
* Document service reference documentation:
@haughki
haughki / mixed_context_ccr.py
Last active November 25, 2020 00:06
NOTE: this doesn't work -- here as a broken example. A dragonfly global CCR rule which references two rules, one of which has an app-specific context. Expect that you can CCR all commands in "code" app, but only Example2 commands in any other context.
from dragonfly import *
from supporting import utils
class Example(MappingRule):
context = AppContext(executable="code") # app-specific context
#exported = False
mapping = {
"command one": Text("comm 1 "),
"command two": Text("comm 2 "),
}
export default class MyClass {
doSomething() {
}
}
import MyClass from '../MyClass'
let myClass = null
beforeEach(() => {
myClass = new MyClass()
})
test('testing', () => {
myClass.doSomething()