Skip to content

Instantly share code, notes, and snippets.

View ihorvorotnov's full-sized avatar
🇺🇦
Working remotely since 1999

Ihor Vorotnov ihorvorotnov

🇺🇦
Working remotely since 1999
View GitHub Profile

SSL certificates aren't cheap. You can create them on your own for private use. However for internet use you have to get a verified certificate.

Luckily there's https://www.startssl.com/

They offer you a class 1 SSL certificate for free. Their site might not look trustworthy, but I quite shure the'll do a greate job.

@ihorvorotnov
ihorvorotnov / gist:a306ceb7a4bbf64abb3a
Last active August 29, 2015 14:03
Custom pages without WordPress theme
/**
* This is one of the few WordPress constants that truly opens up a wide variety of possibilities for any developer.
* What it does is relatively simple, though: it tells WordPress whether or not to load the theme you’re using, which
* allows you to use all WordPress’s functionality for something that doesn’t look like WordPress at all!
* For example, you can create a file named index_non_wp.php and put this snippet in:
*/
// The next line is commented out to tell WP to not load theme
//define('WP_USE_THEMES', true);
@ihorvorotnov
ihorvorotnov / README.md
Last active August 29, 2015 14:07 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@ihorvorotnov
ihorvorotnov / my-plugin.php
Created October 15, 2014 04:45
Basic WordPress plugin, non-OOP
<?php
/**
* Plugin Name: My Custom Post Types
* Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Description: A brief description of the Plugin.
* Version: 1.0.0
* Author: My Name
* Author URI: http://URI_Of_The_Plugin_Author
* License: A "Slug" license name e.g. GPL2
*/
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
<?php
/*
Usage:
cache_fragment_output( 'unique-key', 3600, function () {
functions_that_do_stuff_live();
these_should_echo();
});
*/
function cache_fragment_output( $key, $ttl, $function ) {
<?php
/**
* Must-Use Functions
*
* A class filled with functions that will never go away upon theme deactivation.
*
* @package WordPress
* @subpackage GRD
*/
class GRD_Functions {
<?php
/**
* A class filled with functions that will never go away upon theme deactivation
*
* @package WordPress
* @subpackage GRD
* @version 0.1.0
*/
class GRD_Functions {
scp -r username@remotehost.com:wordpress /local/wordpress
@ihorvorotnov
ihorvorotnov / wp_links_includes.php
Created May 8, 2015 14:31
Proper linking in WordPress theme templates