Skip to content

Instantly share code, notes, and snippets.

Bernat Fortet bernatfortet

Block or report user

Report or block bernatfortet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Add jquery + function
javascript:(function(){var%20el=document.createElement(%22div%22),b=document.getElementsByTagName(%22body%22)[0],otherlib=!1,msg=%22%22;el.style.position=%22fixed%22,el.style.height=%2232px%22,el.style.width=%22220px%22,el.style.marginLeft=%22-110px%22,el.style.top=%220%22,el.style.left=%2250%25%22,el.style.padding=%225px%2010px%22,el.style.zIndex=1001,el.style.fontSize=%2212px%22,el.style.color=%22#222%22,el.style.backgroundColor=%22#f99%22;function%20doAction(){
var remindersText = $('.an.cF .rv .bg span');
var strings = [];
remindersText.each(function(){
strings += $(this).text() + "\n";
console.log( strings );
});
prompt("Copy to clipboard: Ctrl+C, Enter", strings);
View Inbox reminders to clipboard
var strings = [];
cleanReminder = function(){
var reminders = $('.scroll-list-item');
if( reminders.length == 0 ){
prompt("Copy to clipboard: Ctrl+C, Enter", strings);
} else {
var reminder = $('.scroll-list-item').first();
var reminderText = reminder.find('.an.cF .rv .bg span');
var reminderDoneButton = reminder.find('.itemIconDone');
@bernatfortet
bernatfortet / Presto tool improvement scripts bookmarklet
Last active Mar 22, 2016
How to install: 1. Create a new bookmark | 2. type any name | 3. in the url, paste this code | 4. when in the wand, press on the bookmark | 5. Voila!
View Presto tool improvement scripts bookmarklet
javascript:(function(){
$("#unclaimed-session").bind("DOMSubtreeModified", function() {
var unclaimedUsers = $("#unclaimed-session").children().length;
$('.convo-heading').first().html('Unclaimed Users — ' + unclaimedUsers);
});
})();
View Sketch Shortcuts
defaults write ~/Library/Preferences/com.bohemiancoding.sketch3 NSUserKeyEquivalents '{
"Center Canvas" = "@1";
"ArtboardZoom - Zoom to selected Artboard" = "@2";
"Zoom Selection" = "@3";
"Actual Size" = "@4";
"Grid Settings..." = "^$g";
"Top" = "@^8";
"Right" = "@^6";
"Left" = "@^4";
"Bottom" = "@^2";
View Get All Icon names
// Step 1
// First, add a bookmarklet to add jQuery to the given page. For that bookmarlet add the following code
// javascript:(function ()%7B%0A if(window.jQuery)%7B%0A alert('jQuery already loaded.');%0A %7Delse%7B%0A var script = document.createElement("script");%0A script.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";%0A document.head.appendChild(script);%0A alert('jQuery Loaded.');%0A %7D%0A %0A%7D())
//(more info here: http://www.learningjquery.com/2006/12/jquerify-bookmarklet)
//Step 2
//Run This code in the console
$('.glyph').each(function(){
var glyphName = $(this).find('.glyphName').text();
var liga = $(this).find('.liga');
View 2048.js
function pressUp(){
pressKey('up');
}
function pressRight(){
pressKey('right');
}
function pressDown(){
pressKey('down');
View getPhotosFromUnsplash.js
$('.post').each(function(i){
var _this = this;
if( i > 50 && i < 100 ){
setTimeout(function(){
var imgUrl = $(_this).find('img').attr("src");
var a = document.createElement('a');
a.href = imgUrl;
a.setAttribute("download","img.png");
document.body.appendChild( a )
View getFlickrPhoto.js
var imgUrl = document.querySelectorAll(".photo-well-media-view img")[1].getAttribute("src");
var a = document.createElement('a');
a.href = imgUrl;
a.setAttribute("download","img.png");
document.body.appendChild( a )
a.click();
View get500pxPhoto.js
document.location = $(".photo_wrap").find("img").attr('src')
View bookmark.js
javascript:void((function(d){var e=d.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','https://gist.githubusercontent.com/bernatfortet/7147147/raw/b8a407ab09e46247770f16a481ed4286fd50f848/getGooglePlayAppIcon.js');d.body.appendChild(e);b_linkedIn();})(document));
You can’t perform that action at this time.