Skip to content

Instantly share code, notes, and snippets.

@jmiserez
jmiserez / rightclick-element-ios-safari-bookmarklet.js
Last active October 22, 2018 08:27 — forked from foobear/copy-element-text-bookmarklet.js
JavaScript bookmarklet to right click an element in Safari Mobile. Only works when "Request Desktop Site" is used, tested on 12.0.1. Adapted from https://gist.github.com/foobear/f19f2cca87eaf005922323fe04f993c7 (license: MIT).
# Bookmarklet on one line:
javascript:(function(){var x=0;var y=0;var overlay=document.createElement('div');Object.assign(overlay.style,{position:'fixed',top:0,left:0,width:'100vw',height:'100vh',zIndex:99999999,background:'transparent',cursor:'crosshair'});document.body.append(overlay);overlay.addEventListener('click',function(event){Object.assign(overlay.style,{width:0,height:0});x= event.clientX;y=event.clientY; var element=document.elementFromPoint(x,y);var position=element.getBoundingClientRect();Object.assign(overlay.style,{background:'rgba(0,128,255,0.25)',outline:'1px solid rgba(0,128,255,0.5)',top:''+position.top+'px',left:''+position.left+'px',width:''+position.width+'px',height:''+position.height+'px'});setTimeout(function(){var ev1=new MouseEvent("mousedown",{bubbles:true,cancelable:false,view:window,button:2,buttons:2,clientX:x,clientY:y});element.dispatchEvent(ev1);var ev2=new MouseEvent("mouseup",{bubbles:true,cancelable:false,view:window,button:2,buttons:0,clientX:x,clientY:y});element.dispatc
@jmiserez
jmiserez / noip
Last active April 17, 2016 14:19 — forked from PaulMaddox/noip
Dynamic DNS for Amazon Route53, using cli53 and remote OpenDNS resolver
#!/bin/bash
# Original author: https://gist.github.com/PaulMaddox/9210543
# Requires cli53 to be installed
# https://github.com/barnybug/cli53
DNS_NAME="home";
DNS_ZONE="example.com";
# not needed, we have a ~/.boto file