Skip to content

Instantly share code, notes, and snippets.

@pravid
pravid / iframe.html
Created May 20, 2021 17:22 — forked from cirocosta/iframe.html
Sending messages from child iframe to parent webpage
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>Botão</button>
<script type="text/javascript">
@pravid
pravid / gist:cbdab0ee236695dead0ae1fd0cb07c32
Created November 27, 2019 14:31 — forked from ichord/gist:9808444
demo of using pdf.js to extract pages to images
<script src="http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing-api.min.js"></script><html>
<!--
Created using jsbin.com
Source can be edited via http://jsbin.com/pdfjs-helloworld-v2/8598/edit
-->
<body>
<canvas id="the-canvas" style="border:1px solid black"></canvas>
<input id='pdf' type='file'/>
<!-- Use latest PDF.js build from Github -->
@pravid
pravid / bradvin.social.share.urls.txt
Created September 17, 2019 12:14 — forked from HoldOffHunger/bradvin.social.share.urls.txt
Social Share URL's (Summary)
http://compose.mail.yahoo.com/?to={email_address}&subject={title}&body={url}
http://digg.com/submit?url={url}
http://pinterest.com/pin/create/link/?url={url}
http://service.weibo.com/share/share.php?url={url}&appkey=&title={title}&pic=&ralateUid=
http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={url}
http://surfingbird.ru/share?url={url}&description={text}&screenshot={image}&title={title}
http://vk.com/share.php?url={url}&title={title}&comment={text}
http://widget.renren.com/dialog/share?resourceUrl={url}&srcUrl={url}&title={title}&description={text}
http://www.addthis.com/bookmark.php?url={url}
http://www.douban.com/recommend/?url={url}&title={title}

Microsoft 70-480 Exam Study Guide

Programming in HTML5 with JavaScript and CSS3

Table of Contents

Intro

@pravid
pravid / index.html
Created March 29, 2019 13:13 — forked from fcingolani/index.html
How to render a full PDF using Mozilla's pdf.js
<html>
<body>
<!-- really dirty! this is just a test drive ;) -->
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>
<script type="text/javascript">
function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1 };
@pravid
pravid / viewer.html
Created October 29, 2018 13:01 — forked from squallstar/viewer.html
Pinch gestures for pdf.js
<script type="text/javascript">
var gesturesSetUp = false;
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
document.addEventListener('textlayerrendered', function (e) {
if (gesturesSetUp || e.detail.pageNumber !== PDFViewerApplication.page) {
return;
}
@pravid
pravid / pdfSearchView.js
Last active November 14, 2018 13:24
Generate search result for pdfjs search
// JavaScript Document
var isSearchInitialized = false;
var searchObj = {};
var searchPageCount = 0;
var searchResultArray = [];
var searchFoundCount = -1;
var pdfSearchView = {
fnActivatePdfSearch: function () {