This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Blank snippet | |
description: Creates a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
var counter = 1; | |
Word['run'](async function (context) { | |
let doc = context.document; | |
let endOfBodyRange = doc.body.getRange(Word.RangeLocation.end); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delete a read-only content control | |
description: trying to demo a bug | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
var counter = 1; | |
Word['run'](async function (context) { | |
let doc = context.document; | |
let endOfBodyRange = doc.body.getRange(Word.RangeLocation.end); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Insertion order test | |
description: trying to demo a bug | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
var counter = 1; | |
Word['run'](async function (context) { | |
var doc = context.document; | |
var ccs = doc.contentControls.getByTag("EXAMPLE_TAG1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Blank snippet | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
$("#run").click(() => tryCatch(run)); | |
async function run() { | |
await Word.run(async (context) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attribute?(key) | |
# this method is used only for conditional type access. | |
# When included on an object with read observations, don't count this as an observable read | |
if respond_to? :unobservable_read_attribute | |
value = unobservable_read_attribute key | |
else | |
value = read_attribute key | |
end | |
return false if value.nil? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'spec_helper' | |
module CiteProc | |
module Ruby | |
describe "Renderer#render_names" do | |
let(:renderer) { Renderer.new } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Adapted from https://gist.github.com/cantino/d1a63045fbfe5fc55a94 | |
module ContactList | |
class GoogleContactsApi | |
MAX_RESULTS = "250" | |
attr_reader :client | |
def initialize(client, auth) | |
@client = client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rivets.configure({ | |
adapter:{ | |
subscribe:function (obj, keypath, callback) { | |
if (obj instanceof Backbone.Collection) { | |
obj.on('add remove reset', function () {callback(obj);}); | |
} else if(obj.get(keypath) instanceof Backbone.Collection) { | |
obj.get(keypath).on('add remove reset', function (m,v) {callback(obj.get(keypath));}); | |
} else { | |
obj.on('change:' + keypath, function (m, v) {callback(v)}); | |
} |