Skip to content

Instantly share code, notes, and snippets.

View stvaruzek's full-sized avatar

stvaruzek

View GitHub Profile
@tanaikech
tanaikech / submit.md
Created August 20, 2018 01:03
Replacing Text to Image for Google Document using Google Apps Script

Replacing Text to Image for Google Document using Google Apps Script

This is a sample script for replacing text to image for Google Document using Google Apps Script (GAS). There is a method for replacing text to text at Class Text of DocumentApp. But there are not methods for replacing text to image. So I created this sample script.

Demo :

This sample image was created by k3-studio.

Usage :

@danrouse
danrouse / gmail-compose-encoder.js
Created May 3, 2018 16:22
gmail `compose` query parameter encoder/decoder
const fullAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const restrictedAlphabet = 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz';
const threadPrefix = 'thread-';
const messagePrefix = 'msg-';
const isWhitespace = str => /^[\s\xa0]*$/.test(str);
const isInvalidString = str => str ? (str.indexOf(threadPrefix) !== -1 || str.indexOf(messagePrefix) !== -1) : false;
const encode = function(str) {
if (isWhitespace(str)) return str;
@andy722
andy722 / deploy.bat
Created July 9, 2012 09:52
Windows batch: iterate over a static array - copies specified files
@echo off
set SRC=C:\some-path
set TARGET=\\REMOTE-HOST\other-path
set FILE_LIST=(file1.py file2.py file3.py file4.py)
for %%i in %FILE_LIST% do copy /Y %SRC%\%%i %TARGET%
@fatihacet
fatihacet / pubsub-simple.js
Created October 15, 2011 22:02
Simple PubSub implementation with JavaScript - taken from Addy Osmani's design patterns book -
var pubsub = {};
(function(q) {
var topics = {}, subUid = -1;
q.subscribe = function(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
}
var token = (++subUid).toString();
topics[topic].push({
token: token,