Skip to content

Instantly share code, notes, and snippets.

Avatar

Pat Mächler valioDOTch

View GitHub Profile
@valioDOTch
valioDOTch / google-dorks
Created Jul 24, 2021 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
View google-dorks
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@valioDOTch
valioDOTch / loadingbar.py
Created Dec 15, 2016
Gimp loading bar script
View loadingbar.py
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 Aug 10, 2016
Anonymize Facebook discussions
View anonymizeFacebookDiscussion.js
//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 Jun 28, 2016
Detect browser which break file selection if accept attribute is provided
View detect-broken-accept-browers.js
//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;
View test.json
{
"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 }
]
}
View gist:db621bc67e55b167aec7

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

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