-
getAllLinks.js
-
getAllLinks(element) - returns array of all UrlLinks in Document
-
findAndReplaceLinks(searchPattern,replacement) - changes all matching links in Document
-
changeCase.js - Document add-in, provides case-change operations in the add-in Menu.
-
onOpen - installs "Change Case" menu
-
_changeCase - worker function to locate selected text and change text case. Case conversion is managed via callback to a function that accepts a string as a parameter and returns the converted string.
-
helper functions for five cases
This file contains 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
const emojis = [ | |
0x1f201, | |
0x1f202, | |
0x1f21a, | |
0x1f22f, | |
0x1f232, | |
0x1f233, | |
0x1f234, | |
0x1f235, | |
0x1f236, |
This file contains 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
const fs = require('fs'); | |
function main() { | |
const mods = Object.keys(require("./package.json").dependencies); | |
mods | |
.forEach(mod => { | |
const {license: a, LICENSE: b, main} = require(`./node_modules/${mod}/package.json`); |
This file contains 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
--- | |
ssl_certificates: | |
- certificate_src: secure.example.com.pem | |
certificate_dest: /etc/ssl/certs/secure.example.com.pem | |
key_src: secure.example.com.protected.key | |
key_dest: /etc/ssl/private/secure.example.com.protected.key | |
key_stripped: /etc/ssl/private/secure_example.com.key | |
key_password: "{{ssl_passphrase}}" |
This file contains 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
// http://stackoverflow.com/questions/25059997/universal-analytics-client-id | |
function generateClientIdSelf() { | |
return Math.floor(Math.random() * 0x7FFFFFFF) + "." + Math.floor(Date.now() / 1000); | |
} | |
// https://www.google-analytics.com/analytics.js | |
function generateClientIdGA() { | |
function hd() { | |
return math.round(2147483647 * math.random()); | |
} |
This file contains 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 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.http import Http404 | |
from django.http import JsonResponse, HttpResponseRedirect, HttpResponsePermanentRedirect | |
from django.http import HttpResponseBadRequest, HttpResponseForbidden | |
from django.views.generic import TemplateView | |
from django.utils.decorators import method_decorator |
This file contains 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
from threading import local | |
class Bucket(object): | |
def __init__(self, bucket, s3=None): | |
if s3 is None: | |
s3 = s3_storage | |
self.bucket = bucket | |
self.s3 = s3 |
This file contains 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
upstream tornadoFrontends { | |
server 127.0.0.1:8000; | |
server 127.0.0.1:8001; | |
server 127.0.0.1:8002; | |
server 127.0.0.1:8003; | |
} | |
server { | |
listen 80; | |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Simple async crawler/callback queue based on gevent.""" | |
import traceback | |
import logging | |
import httplib2 | |
import gevent |
This file contains 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 human_size(size): | |
import re | |
def sub(m): | |
return '%s.%s%s' % (m.group(1), m.group(2)[:2], 'BKMGT'[len(m.group(2))/3]) | |
return re.sub(r'^(\d{1,3})((?:\d\d\d){1,4})$', sub, str(size)) |