Skip to content

Instantly share code, notes, and snippets.

@0x4a
0x4a / tidy_cms.bat
Created September 24, 2014 05:46
tidy plentymarkets layout sources while preserving cms syntax - #work #regex #batch
@ECHO OFF & REM coding:oem;
:: Copyright (c) 2014, Daniel Jackel / Samenhaus Müller
:: licensed under the BSD-new license (samenhaus.de/layout/license.txt)
:: www.samenhaus.de / [email protected]
IF [%1] == [] ECHO usage: %0 ^<file^> & exit /b
IF NOT EXIST %1 ECHO file not found: %1 & exit /b
ECHO hide cms syntax
sed -e "s/\([^\x22]\|^\){%% /\1<!--{ %% /g" -e "s/ %%}\([^\x22]\|$\)/ %% }-->\1/g" %1 > %1.$$ && mv %1.$$ %1
@0x4a
0x4a / ColorHashMenu.user.js
Last active August 29, 2015 14:07
ColorHashMenu for #plenty #userscript #work
// ==UserScript==
// @id 465249
// @name pm_ColorHashMenu
// @version 0.5a
// @namespace samenhaus.de
// @author Daniel Jackel <[email protected]> http://0x4a.net/
// @description Color the PlentyMarkets menu at the top according to hostname. Extremely usefull if you have multiple accounts instead of multishops.
// @include */plenty/ui/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
@0x4a
0x4a / readability.js
Created October 9, 2014 20:40
read with readability.com - #bookmarklet
javascript:((function(){window.baseUrl='http://www.readability.com';window.readabilityToken='';var s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','UTF-8');s.setAttribute('src',baseUrl+'/bookmarklet/read.js');document.documentElement.appendChild(s);})())
@0x4a
0x4a / pinboard_insta-safe.js
Created October 9, 2014 20:41
#pinboard.in - instantly safe with tag .@blog - #bookmarklet
javascript:void(t=open('https://pinboard.in/add_noui?priv=yes&jump=close&tags='%20+%20encodeURIComponent(".@blog")%20+%20'&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'Pinboard','toolbar=no,width=100,height=100'));t.blur();
@0x4a
0x4a / pinboard_popup-with-tags.js
Created October 9, 2014 20:41
#pinboard.in open popup with tags - #bookmarklet
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://pinboard.in/add?showtags=yes&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,scrollbars=yes,width=750,height=700'));
@0x4a
0x4a / pinboard_read-later.js
Last active August 29, 2015 14:07
#pinboard.in safe as read later - #bookmarklet
javascript:q=location.href;p=document.title;void(t=open('https://pinboard.in/add?later=yes&noui=yes&jump=close&url='+encodeURIComponent(q)+'&tags='+encodeURIComponent("@dump")+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=100,height=100'));t.blur();
@0x4a
0x4a / instapaper.js
Created October 9, 2014 20:42
safe to instapaper - #bookmarklet
javascript:function%20iprl5(){var%20d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...)%20'+d.title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/GQAYUSAQ8DUp?a=read-later&u='+encodeURIComponent(l.href)+'&t='+(new%20Date().getTime()));b.appendChild(z);}catch(e){alert('Please%20wait%20until%20the%20page%20has%20loaded.');}}iprl5();void(0)
@0x4a
0x4a / mycloudplayer.js
Created October 9, 2014 20:43
Play in MyCloudPlayer - #bookmarklet
javascript:(function(){var%20h=window.location.hostname.toLowerCase();if('www.soundcloud.com'==h||'soundcloud.com'==h){location.href='http://mycloudplayers.com/#url='+location.href;}else{alert('This%20only%20works%20on%20SoundCloud%20pages!')}})()
@0x4a
0x4a / quickedit.js
Created October 9, 2014 20:43
quickedit - #bookmarklet
data:text/html,%20<html%20contenteditable>
@0x4a
0x4a / show-grid.js
Created October 9, 2014 20:44
show grid - #bookmarklet
javascript:function%20fnStartGrid(sUrl)%20{var%20nScript%20=%20document.createElement('script');nScript.setAttribute('language','JavaScript');nScript.setAttribute('src',sUrl);document.body.appendChild(nScript);}fnStartGrid('http://www.sprymedia.co.uk/design/grid/media/js/grid-loader.js');