Skip to content

Instantly share code, notes, and snippets.

View jsoncorwin's full-sized avatar

Jason Corwin jsoncorwin

View GitHub Profile
function sendOptimizelyEvent(eventId, key) {
try {
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
@jsoncorwin
jsoncorwin / gist:4300115
Last active December 9, 2015 16:58 — forked from zain/gist:4291724
import re
import string
# find the first quote in a string
quotere = re.compile(
r"""(?P<quote>"[^\"\\]*(?:\\"|[^"])*") # Quote, possibly containing encoded
# quotation mark
\s*(?P<rest>.*)$ """,
re.VERBOSE)