Skip to content

Instantly share code, notes, and snippets.

View valioDOTch's full-sized avatar

Pat Mächler valioDOTch

View GitHub Profile
@valioDOTch
valioDOTch / Miro-Share-Project-Bookmarklet.js
Last active February 2, 2024 08:36
Miro share project board bookmarklet
/*
* Code for a bookmarklet to get a shareable link to Miro project
*
* installation: use the URL of this Gist on https://www.yourjs.com/bookmarklet/ to add a Bookmarklet to your browser bar.
*
* usage: click on the bookmarklet, after opening up a Miro project.
* it will add a link icon (🔗) on the right hand side of the project title (next to the ➕ plus icon)
* When you click on the link, a dialog appears that provides you with a URL to share in chats or emails.
* Be aware that this might break.
*
@valioDOTch
valioDOTch / google-dorks
Created July 24, 2021 11:39 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@valioDOTch
valioDOTch / loadingbar.py
Created December 15, 2016 15:12
Gimp loading bar script
images = gimp.image_list()
layers = images[0].layers
width = gimp.pdb.gimp_image_width(images[0])
height= gimp.pdb.gimp_image_height(images[0])
opacity = 100
parent_layer = None
above_active_layer = -1
for x in range(0,width):
gimp.pdb.gimp_image_select_rectangle(images[0],CHANNEL_OP_REPLACE,x,0,1,height)
gimp.pdb.gimp_edit_cut(layers[0])
@valioDOTch
valioDOTch / anonymizeFacebookDiscussion.js
Created August 10, 2016 23:09
Anonymize Facebook discussions
//for now this has to be entered via the console
//TODO make a bookmarklet out of it
var pattern = prompt("Input the name"),
re = new RegExp(pattern, "g");
document.body.innerHTML = document.body.innerHTML.replace(re,"Anon");
var imgs = document.querySelectorAll("img[alt='Anon']");
var array = Array.prototype.concat.call(imgs[0],[]);
for (var i = 0; i<imgs.length; i++) {
imgs[i].src = "https://www.facebook.com/rsrc.php/v2/yX/r/XUrzDRBrRPS.png";
@valioDOTch
valioDOTch / detect-broken-accept-browers.js
Last active June 28, 2016 10:31
Detect browser which break file selection if accept attribute is provided
//Some mobile browsers have issues with the accept attribute in file input fields, which breaks the file selection for users
//Thus while the accept attribute enhances UX, it should not be used everywhere
//For details of browsers with broken behaviour see http://caniuse.com/#feat=input-file-accept
var breaksFileSelectionForFileInputsWithAcceptAttribute = function(){
//via http://stackoverflow.com/questions/14403766/how-to-detect-the-stock-android-browser
var isNativeAndroidBrowser = (function(){
var navU = navigator.userAgent;
{
"records": [
{ "folder":false, "text": "Application.js", "size": 23 },
{ "folder":false, "text": "Button.js", "size": 1337 },
{ "folder":false, "text": "Cycle.js", "size": 42 },
{ "folder":false, "text": "Split.js", "size": 512 },
{ "folder":true, "text": "Folder", "size": 0 }
]
}

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

.ext-ux-clearbutton {
width: 12px;
height: 12px;
background-image: url(data:image/gif;base64,R0lGODlhDAAwAPcAAAAAAB42cyZDkH+Otp+y4wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA