Skip to content

Instantly share code, notes, and snippets.

View atchyut-re's full-sized avatar

Atchyut Nagabhairava atchyut-re

View GitHub Profile
@atchyut-re
atchyut-re / responsive-voice.js
Created July 19, 2016 10:31 — forked from anchetaWern/responsive-voice.js
responsive-voice.js
//Look for other responsivevoice instances
/*if (window.parent != null) {
var iframes = window.parent.document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
//iframes[i].style.width = "300px"
}
}*/
if (typeof responsiveVoice != 'undefined') {
console.log('ResponsiveVoice already loaded');
@atchyut-re
atchyut-re / background_color_picker.js
Created February 13, 2017 09:23 — forked from georgebyte/background-color-picker.js
jQuery: Background color picker (pick color from image by clicking on it)
var image = new Image();
image.src = "sample.jpg";
$(image).load(function() {
ctx.drawImage(image, 0, 0);
});
$(canvas).click(function(e) {
var canvasOffset = $(canvas).offset();
var canvasX = Math.floor(e.pageX-canvasOffset.left);
var canvasY = Math.floor(e.pageY-canvasOffset.top);