Skip to content

Instantly share code, notes, and snippets.

View dejanmarkovic's full-sized avatar
💭
WordPress development 24/7

Dejan Markovic dejanmarkovic

💭
WordPress development 24/7
View GitHub Profile
@dejanmarkovic
dejanmarkovic / new_gist_file.php
Created December 10, 2013 17:02
Load page with PHP
$handle = file_get_contents("http://mysite/y_filename.php , "b");
echo $handle;
@dejanmarkovic
dejanmarkovic / Load_page_with_jQuery.js
Created December 10, 2013 17:00
Load page with jQuery
$( "body" ).load( "page_name_here.php", function() {
alert( "Load was performed." );
});
@dejanmarkovic
dejanmarkovic / new_gist_file_0
Created December 7, 2013 14:34
Adding vietual host in apache on Xampp
Go to:
C:\xampp\apache\conf\extra\
Edit:
httpd-vhosts.conf
First you need to add xamp/localhost:
<VirtualHost *:80>
DocumentRoot "C:/xampp2/htdocs"
@dejanmarkovic
dejanmarkovic / new_gist_file_0
Created December 4, 2013 16:44
Expires headers (for better cache control) Source: www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/ I have updated for pdf & swf
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
#
# These are pretty far-future expires headers
# They assume you control versioning with cachebusting query params like:
# <script src="application.js?20100608">
# Additionally, consider that outdated proxies may miscache
#
@dejanmarkovic
dejanmarkovic / wp_jQuery.expander.js
Created November 26, 2013 22:53
This is DIRTY solution. If you want to use normal solution with WordPress use wp_enqueue_script In order to have jQuery.expander working in WordPress put the plugin code inside the "$(document).ready(function() " part.
/*!
* Expander - v1.4.7 - 2013-08-30
* http://plugins.learningjquery.com/expander/
* Copyright (c) 2013 Karl Swedberg
* Licensed MIT (http://www.opensource.org/licenses/mit-license.php)
*/
$(document).ready(function() {
(function($) {
$.expander = {
version: '1.4.7',
@dejanmarkovic
dejanmarkovic / new_gist_file
Created November 23, 2013 16:14
Installing vip-quickstart
1. Download Virtual Box 4.2 (make sure it's NOT 4.3) Posted on Nov 11 2013
2. Download VirtualBox 4.3.2 Oracle VM VirtualBox Extension Pack from here https://www.virtualbox.org/wiki/Downloads
2. Download Vagrant http://www.vagrantup.com/
3. Download https://github.com/Automattic/vip-quickstart
@dejanmarkovic
dejanmarkovic / new_gist_file
Created November 20, 2013 20:49
How To Disable IPv6 In Windows 7
go here: http://www.addictivetips.com/windows-tips/how-to-disable-ipv6-in-windows-7/
@dejanmarkovic
dejanmarkovic / new_gist_file
Created November 20, 2013 20:35
Apache slow on (local machine) localhost
For me, setting the ServerName property in httpd.conf fixed the delays (they were up to 10 seconds at worst):
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
ServerName 127.0.0.1:80
Source: http://serverfault.com/questions/66347/the-localhost-response-very-slow-why
@dejanmarkovic
dejanmarkovic / new_gist_file
Last active May 4, 2020 19:59
Win7 no restart needed after change in hosts file
hostfile location WIN7
------------------
C:\Windows\System32\drivers\etc
After change in hosts file
1. ipconfig /flushdns will flush the local dns cache.
2. nbtstat -R will flush netbios cache. <----- Should be with Capital "R
3. restart browsers (FF may need 60 seconds to recognise changes)
Chrome
@dejanmarkovic
dejanmarkovic / new_gist_file
Created November 14, 2013 15:59
Copying multi-site to another location
1. Make sure to change the vlaues in the database from "olddomain.com" to "newdomain.com"
2. also make sure to change values in the database with "http://" from "http://olddomain.com" to "http://newdomain.com"
3. double check the valuse in the table "wp_blogs"