Skip to content

Instantly share code, notes, and snippets.

View pixelbart's full-sized avatar
👋
Hi

Kevin Pliester pixelbart

👋
Hi
View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
anonymous
anonymous / .htaccess
Created July 3, 2012 08:32
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 2 hours "
ExpiresByType text/xml "access plus 2 hours"
ExpiresByType image/gif "access plus 3 weeks"
ExpiresByType image/jpg "access plus 2 weeks"
ExpiresByType image/png "access plus 3 weeks"
ExpiresByType video/quicktime "access plus 2 months"
ExpiresByType audio/mpeg "access plus 2 months"
ExpiresByType application/pdf "access plus 2 weeks"
@Zodiac1978
Zodiac1978 / .htaccess
Last active June 10, 2024 18:57
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
@ScottPhillips
ScottPhillips / Widget_Setup.php
Created January 21, 2013 16:03
OOP Style Widgets for Wordpress
class Widget_Setup
{
public $widget_class = '';
public $admin_styles = array();
public $admin_scripts = array();
public $front_styles = array();
public $front_scripts = array();
public $script_defaults = array(
'handle' => '',
@opnchaudhary
opnchaudhary / gmaps_3.html
Created July 5, 2013 04:26
Get latitude and longitude from google maps
<!doctyp html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Get Latitude and Longitude</title>
<script src="http://maps.google.com/maps/api/js?libraries=places&region=uk&language=en&sensor=true"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
@hlashbrooke
hlashbrooke / function.php
Last active July 4, 2022 21:35
WordPress: Display posts in a random order, but retain persistent pagination
<?php
session_start();
add_filter( 'posts_orderby', 'randomise_with_pagination' );
function randomise_with_pagination( $orderby ) {
if( is_front_page() ) {
// Reset seed on load of initial archive page
u = location.href;
t = "takuya-hateblo-22";
a = (function(url, tag) {
asin = (function(url) {
if (r = url.match(/gp\/product\/([^\/]+)/)) {
return r[1];
} else if (r = url.match(/dp\/([^\/]+)/)) {
return r[1];
} else {
return;
@slushman
slushman / customizer-links.php
Last active September 23, 2023 13:03
How to link into the WordPress Customizer
@pixelbart
pixelbart / .htaccess
Last active April 10, 2017 10:37
Browser Caching with .htaccess
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|ttc|ttf|woff)$">
@Mo45
Mo45 / discord.msg.send.php
Last active July 22, 2024 21:54
PHP - Send message to Discord via Webhook
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting