Skip to content

Instantly share code, notes, and snippets.

View peteee's full-sized avatar
:octocat:
Meow

Peter Oberlaender peteee

:octocat:
Meow
View GitHub Profile
@peteee
peteee / rot13emaildecrypter.js
Last active May 28, 2018 20:18
Replace a mailto:email addr. -link with this handy lil snippet
/**
* ROT13 Email Decrypter
* -TextMate-style-
*
* Creates a mailto: -Email link
* Hides Email addresses from spam bots
* Format: [email protected]: [email protected]
*
* @author Peter Oberlaender
*/
jQuery(document).ready(function() {
// Customize your texts here:
var cCText = "Wir verwenden Cookies, um Ihnen die bestmögliche Erfahrung auf unserer Website zu bieten. Wenn Sie fortfahren, ohne Ihre Einstellungen zu ändern, gehen wir davon aus, dass Sie alle Cookies auf dieser Website akzeptieren.",
cCBtnText = "OK",
cCBtnText2 = "Datenschutzhinweise",
cCLink = "/de/datenschutz";
// Style overides to change colors. Leave blank for default:
var cCBGColor = "#4e4e4e",
cCTextColor = "#fff",
cCBtn1Color = "green",
jQuery(document).ready(function() {
// Customize your texts here (EN/DE):
if(jQuery('html').attr('lang')=='en') { //if the lang attribute exists, otherwise change accordingly
var cCText = "We use cookies to give you the best experience on our website. If you continue without changing your settings, we will assume that you are happy to receive all cookies on this website.",
cCBtnText = "OK",
cCBtnText2 = "Privacy Policy",
cCLink = "/en/privacy-policy";
} else {
var cCText = "Wir verwenden Cookies, um Ihnen die bestmögliche Erfahrung auf unserer Website zu bieten. Wenn Sie fortfahren, ohne Ihre Einstellungen zu ändern, gehen wir davon aus, dass Sie alle Cookies auf dieser Website akzeptieren.",
cCBtnText = "OK",
/**
* Cookies
*/
function createNCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
@peteee
peteee / scrollTopArrow.js
Created November 27, 2018 22:40
Paste'N'Ready
/**
* Scroll Top Arrow
*/
jQuery('body').append('<div id="scroll-top" style="display:none;position: fixed;bottom: 40px;right: 40px;color: #000;font-size: 56px;z-index: 999999;height: 70px;width: 70px;transform: rotate(-90deg) scale(1,1.2);text-shadow: -1px -1px 0 #FFF, 1px -1px 0 #FFF, -1px 1px 0 #FFF, 1px 1px 0 #FFF;cursor: pointer;">&#x27A4;</div>');
jQuery(document).scroll(function() {
var y = jQuery(this).scrollTop();
if (y > 1200) {
jQuery('#scroll-top').fadeIn();
} else {
jQuery('#scroll-top').fadeOut();
@peteee
peteee / overlay.js
Created March 6, 2019 20:49
overlay.js
var overlayContent = '<h2 style="margin-top: 3px;color:#96ffd7;">Headline</h2>';
overlayContent += '<p>Lorem ipsum dolor...</p>';
var overlayBGCol = '#FFF';
var overlayTxtCol = '#000';
window.overlay = ('<div id="overlay" style="display: none; width: 100%; height: 100%; background: rgba(0,0,0, .58); z-index: 20000; position: fixed; text-align: center;top:0px;"><div id="overlay-container" style="width: 600px;height: auto;padding: 17px;background: '+overlayBGCol+';color:'+overlayTxtCol+' !important; display: inline-block;top: 40px;position: relative;border-radius: 30px;-webkit-border-radius: 30px;text-align: left;">'+overlayContent+'<span class="this-overlay-close" style="margin: -20px -4px 0px 0px;position: absolute;top: 21px;right: 11px;color: #CCC;padding: 2px 8px;font-size: 23px;border-bottom-left-radius: 0.7em;-webkit-border-bottom-left-radius: 0.7em;border-top-right-radius: 1.3em;-webkit-border-top-right-radius: 1.3em;cursor: pointer;font-weight: bold;">x</span></div>');
jQuery('body').append(window.ov
@peteee
peteee / dateFlag.js
Last active March 4, 2020 17:54
dateFlag
/**
* Create unique url request flags to force reload...
*/
var d = new Date();
var dateFlag = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate() + "-" + d.getHours() + "-" + d.getMinutes() + "-" + d.getSeconds();
console.log(dateFlag); // logs: 2020-3-4-12-45-31
@peteee
peteee / force-reload.js
Created April 23, 2021 17:01
Force reload of JS every second (jQuery)
jQuery(document).ready(function() {
function checkTime(i) {
return (i < 10) ? "0" + i : i;
}
var today = new Date(),
h = checkTime(today.getHours()),
m = checkTime(today.getMinutes()),
s = checkTime(today.getSeconds());
jQuery('body').append('<script id="data-src" src="https://MYDOMAIN.com/js/MYSCRIPT.js?v='+h+m+s+'"><\/script>');
});
@peteee
peteee / fortune-cowsay-lolcat.md
Created March 12, 2025 14:04 — forked from nucliweb/fortune-cowsay-lolcat.md
fortune | cowsay | lolcat

fortune | cowsay | lolcat

Install Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install fortune

brew search fortune