Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View szepeviktor's full-sized avatar
🍓
Doing byte-level care

Viktor Szépe szepeviktor

🍓
Doing byte-level care
View GitHub Profile
@szepeviktor
szepeviktor / smooth-scroll.js
Last active January 1, 2016 11:29
smooth scroll AMD update
/* =============================================================
Smooth Scroll 3.0
Animate scrolling to anchor links, by Chris Ferdinandi.
http://gomakethings.com
Easing support contributed by Willem Liu.
https://github.com/willemliu
Easing functions forked from Gaëtan Renaudeau.
@szepeviktor
szepeviktor / zepto-amd.js
Last active January 2, 2016 07:49
Zepto 1.1.2 with UMD (no global $)
// Zepto.js
// (c) 2010-2014 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], function () {
return (root.Zepto = factory());
});
@szepeviktor
szepeviktor / parseuri.js
Last active May 10, 2020 08:53
parseUri 1.2.2 Author: Steven Levithan URL: http://blog.stevenlevithan.com/archives/parseuri
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = {
strictMode: false,
key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
q: {
name: "queryKey",
@szepeviktor
szepeviktor / cookies.js
Last active January 2, 2016 09:29
A complete cookies reader/writer framework with full unicode support
/*
*
* :: cookies.js ::
*
* A complete cookies reader/writer framework with full unicode support.
*
* https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
*
* This framework is released under the GNU Public License, version 3 or later.
* http://www.gnu.org/licenses/gpl-3.0-standalone.html
@szepeviktor
szepeviktor / ie8-indexof.js
Created January 6, 2014 13:54
IE8 indexOf polyfill from MDN
// URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) {
if ( this === undefined || this === null ) {
throw new TypeError( '"this" is null or not defined' );
}
var length = this.length >>> 0; // Hack to convert object.length to a UInt32
@szepeviktor
szepeviktor / jquery.easing.js
Created January 6, 2014 15:06
jQuery Easing AMD module v1.3
/*
* jQuery Easing AMD module v1.3
* URL: http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
@szepeviktor
szepeviktor / wp-badrequest.php
Last active December 29, 2018 15:43
WordPress bad request - help Fail2ban to ban "deadly" requests
MOVED to: https://github.com/szepeviktor/wordpress-fail2ban/tree/master/block-bad-requests
@szepeviktor
szepeviktor / google-adwords-remarketing-AMD-config.js
Last active January 4, 2016 04:19
loads Google Remarketing Tag script - nojs image removed
// works with curl.js + js plugin
var curl = {
paths: {
adwords: "//www.googleadservices.com/pagead/conversion.js"
}
},
// I use WordPress
// write your own conversion ID here
WP = {
@szepeviktor
szepeviktor / latin-accents.php
Created January 25, 2014 12:54
Keep latin accents in WordPress - an mu plugin
<?php
/*
Plugin Name: Keep Latin accents
Plugin URI: http://awordpress.net/blog/accents-in-wordpress-permalinks/
Description: Keep Latin accents in URLs
Version: 3.0
Author: Pavel (aka Immortal) Petrov
Author URI: http://www.webbamboo.net/
License: GPL2
*/
@szepeviktor
szepeviktor / MJ12bot.htaccess
Created January 26, 2014 18:40
MJ12bot WordPeess helper rule - adds trailing slash
## MJ12bot WordPeess helper rule
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} MJ12bot
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ $1/ [L,R=permanent]
</IfModule>