Skip to content

Instantly share code, notes, and snippets.

@svebal
svebal / mlp_navigation.php
Created July 26, 2017 09:08
Creating an own markup for MultilingualPress
<?php
/**
* Create a navigation between translated instances
*
* @param array $args {
* Optional. Array of nav menu arguments.
*
* @param string $container Whether to wrap the language switch, and what to wrap it with. Default 'div'.
* @param string $container_class Class that is applied to the container. Default 'language-switch'.
@svebal
svebal / browserWidth.js
Last active July 20, 2017 08:21
display width of browser window in an element
// store wrap div in a variable
$container = $( "body" );
if ( $( "#special" ).length ) {
// element where we will display the document width
$documentWidth = $( '#curr_size' );
// display document width in the container
$documentWidth.text( $container.width() + " px" );
@svebal
svebal / .htaccess
Created September 21, 2015 08:02
Webfont Mime Types
# ----------------------------------------------------------------------
# Webfont access
# ----------------------------------------------------------------------
# allow access from all domains for webfonts
# alternatively you could only whitelist
# your subdomains like "sub.domain.com"
<FilesMatch "\.(ttf|otf|eot|woff|fonts.css|style.css)$">
<IfModule mod_headers.c>
@svebal
svebal / gist:c48f3b2c6b50f2e669ce
Created June 26, 2014 08:45
Apache enabling gzip compression encoding with httpd.conf
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/javascript
</IfModule>
@svebal
svebal / startpage-posts.php
Last active August 29, 2015 14:01
startpage-posts.php
if (is_sticky() ) {
the_content();
} else {
the_excerpt();
}
if (navigator && navigator.platform && navigator.platform.match(/^(iPad|iPod|iPhone)$/)) {
//do something magic
}
@svebal
svebal / iitc-export-import-draw.js
Last active June 11, 2019 10:55
Plugin for IITC - let you im- / export your sketches from drawing tools
// ==UserScript==
// @id iitc-export-import-draw@skamander
// @name IITC plugin: export and import data from draw tools
// @version 0.0.1
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @description Import/Export Data from draw tools
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
<?php
$url = $_GET['url'];
$allowedurls = array(
'http://developer.yahoo.com',
'http://icant.co.uk'
);
if(in_array($url,$allowedurls)){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
# Apache Configuration File
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
# ##############################################################################