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
function addDownloadButtonsToVideos() { | |
const addButton = (video) => { | |
// Check if a download button already exists for this video | |
if (video.parentElement.querySelector('.download-button')) return; | |
// Create the download button | |
const button = document.createElement('button'); | |
button.textContent = 'Download'; | |
button.className = 'download-button'; | |
Object.assign(button.style, { |
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
async function downloadProtectedVideo(videoElement, filename = 'video.mp4') { | |
try { | |
// Create a MediaRecorder to capture the video stream | |
const stream = videoElement.captureStream(); | |
const mediaRecorder = new MediaRecorder(stream, { | |
mimeType: 'video/webm;codecs=vp9' | |
}); | |
const chunks = []; | |
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
1c1 | |
< _Effective: May 20, 2020_ | |
--- | |
> _Effective: August 11, 2020_ | |
53c53 | |
< * *Others Working with Rollbar.* We may share information about you within the United States and abroad, with third party vendors who need to know information about you in order to provide their services to us, or to provide their services to you. This group includes vendors that help us provide our Services to you, such as payment providers that process your credit and debit card information, fraud prevention services that allow us to analyze fraudulent payment transactions, postal and email delivery services that help us stay in touch with you, customer chat and email support services that help us communicate with you, those that assist us with our marketing efforts (e.g. by providing tools for identifying a specific marketing target group or improving our marketing campaigns), those that help us understand and enhance our Services (like analytics providers), and those that help us deliver our Services (like hosting and content deliv |
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
1c1 | |
< _Effective: Dec 27, 2019_ | |
--- | |
> *Effective: July 1, 2020* | |
3c3 | |
< Welcome to Rollbar.com, the website and online service of Rollbar, Inc. (“Rollbar,” “we,” or “us”). This page explains the terms by which you may use our online and/or mobile services, web sites, APIs, SDKs, email notifications, and Software (as defined in 1(c) below) provided on or in connection with the service (collectively, the “Services”). Your access to and use of the Services are conditioned on your acceptance of and compliance with this Terms of of Service Agreement (the “Agreement”). By accessing or using the Services you signify that you have read, understood, and agree to be bound by this Agreement and to the collection and use of your information as set forth in the Rollbar [Privacy Policy](doc:privacy-policy), whether or not you are a registered user of our Services. Rollbar reserves the right to make unilateral modifications to this Agreement and will provide notice of these changes as described below. This Agreement applies t |
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
The regex patterns in this gist are intended only to match web URLs -- http, | |
https, and naked domains like "example.com". For a pattern that attempts to | |
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
# Single-line version: | |
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
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
""" | |
Instead of causing a 404 for cat IDs that are not found, return the parent resource. | |
""" | |
class Root(object): | |
def __getitem__(self, key): | |
if key == 'cats': | |
res = CatList() | |
res.__name__ = key | |
res.__parent__ = self |
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
function ignoreRemoteUncaught(isUncaught, args, payload) { | |
try { | |
var filename = payload.data.body.trace.frames[0].filename; | |
if (isUncaught && !filename.match(/^https?:\/\/www\.mycompany\.com/)) { | |
// Ignore uncaught errors that are not from www.mycompany.com. | |
return true; | |
} | |
} catch (e) { | |
// Most likely there was no filename or the frame doesn't exist. | |
} |
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
function f(addr) { | |
$.getJSON(addr, function(d) { | |
if (d.follow) { | |
f(d.follow); | |
} else { | |
console.log(d); | |
} | |
}) | |
} | |
f('http://letsrevolutionizetesting.com/challenge') |
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
import json | |
import requests | |
import time | |
ACCESS_TOKEN = 'token' | |
payload = { | |
'access_token': ACCESS_TOKEN, | |
'timestamp': int(time.time()), | |
'environment': 'development', | |
'revision': '12345678', |
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
var eventstream = require('event-stream'); | |
var fs = require('fs'); | |
// creates a new write stream on first write() call | |
exports.createLazyWriteStream = function(wsFactory) { | |
var Stream = require('stream'); | |
var s = new Stream; | |
var ws; | |
s.writable = true; |
NewerOlder