Skip to content

Instantly share code, notes, and snippets.

View zorca's full-sized avatar
✴️
Working from a faraway star

Zorca Orcinus zorca

✴️
Working from a faraway star
  • Lithuania
View GitHub Profile
@zorca
zorca / start.html
Last active August 29, 2015 14:13
Стартовый шаблон HTML
<!doctype html>
<html>
<head>
</head>
<body>
</body>
</html>
<?php
// First
$var1 = 2;
$var2 = rand(1, 100);
$result = $var1 + $var2;
echo $result;
echo '<br>';
// Second
if (time() > 1488180411 & time() > 1488958010) add_action('get_header', 'html5press_maintenance_mode');
function html5press_maintenance_mode() {
wp_die('Maintenance, please come back soon.');
}
@zorca
zorca / Carbon
Last active October 16, 2017 17:33
<?php
foreach ($tm_list as $item):
echo carbon_get_post_meta($item['id'], 'crb_field') . '<br>';
endforeach;
<?php
use function Deployer\{server, task, run, set, get, add, before, after, desc, upload, runLocally};
require 'recipe/common.php';
// Configuration
$config = require 'deploy_config.php';
//set('ssh_type', 'native');
set('ssh_multiplexing', true);
//set('repository', 'ssh://gogs@git.server.com:22/user/repo.git');
set('shared_files', ['public/wp-config.php']);
set('shared_dirs', ['public/wp-content/uploads']);
@zorca
zorca / woocommerce-sage-template-part-overrides.md
Created November 24, 2017 07:05 — forked from drawcard/woocommerce-sage-template-part-overrides.md
Woocommerce - Using template part overrides in Sage

So, you know how to override a template file in Woocommerce using Sage, but you're having trouble changing something within the deeper level of that template file. For example, you want to change the output HTML structure of a given part of the product page loop, or incorporate a Bootstrap class into a button element without using Jquery to inject it. Here's how you can override deeper level parts, the default WC theme elements.

Prerequisites

Now you're familiar with how to do Sage + Woocommerce templates, it's time to make it happen.

The template page override

86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace
@zorca
zorca / bootstrap-4-sass-mixins-cheat-sheet.scss
Created August 17, 2018 16:18
Bootstrap 4 Sass Mixins [Cheat sheet with examples] #BS4
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// @author http://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
@zorca
zorca / Gitlabserver.md
Created August 26, 2018 06:09 — forked from HendrikPetertje/Gitlabserver.md
Create your own GitLab server

#Setup Your own Gitlab server from the on-click install image ##Create the server image Login to Digital Ocean and create click the "New Droplet" button. In the page fill out the details for your new droplet. The best thing is to choose $10.- server since this server has the necessary RAM of 1GB. You can however choose for the $5.- server to but this will require setting up Swap once your server is deployed. Now when selecting your image choose "Application" and select GitLab. Create the droplet and wait for your ssh keys to come in.

##Modify the Ubuntu environment. ###Change login details Log in to your root account using your version of the command below

@zorca
zorca / simplepie_example.php
Created October 25, 2018 09:15 — forked from franz-josef-kaiser/simplepie_example.php
SimplePie - example method to list what information we can retrieve about a feed as a whole and for single items when looping through
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) RSS Importer
*/
add_action( 'plugins_loaded', array( 'WCMRSSImporterBootstrap', 'init' ) );
class WCMRSSImporterBootstrap
{
protected static $instance = null;