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
View GitHub Profile
<section data-id="7e2269b" class="elementor-element elementor-element-7e2269b elementor-hidden-phone elementor-section-boxed elementor-section-height-default elementor-section-height-default elementor-section elementor-top-section jet-parallax-section" data-settings="{&quot;background_background&quot;:&quot;classic&quot;,&quot;background_image&quot;:{&quot;url&quot;:&quot;&quot;,&quot;id&quot;:&quot;&quot;}}" data-element_type="section">
<div class="elementor-container elementor-column-gap-default">
<div class="elementor-row">
<div data-id="10f1d3c" class="elementor-element elementor-element-10f1d3c elementor-column elementor-col-100 elementor-top-column" data-element_type="column">
<div class="elementor-column-wrap elementor-element-populated">
<div class="elementor-widget-wrap">
<div data-id="0c035ed" class="elementor-element elementor-element-0c035ed elementor-widget elementor-widget-menu-anchor" data-element_type="menu-anchor.default">
<div class="elementor-widget-container">
@zorca
zorca / youtube_id_regex.php
Created December 8, 2018 13:50 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@zorca
zorca / remove-woocommerce-styles-scripts.php
Created January 18, 2019 09:55 — forked from gregrickaby/remove-woocommerce-styles-scripts.php
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@zorca
zorca / bootstrap-4-sass-mixins-cheat-sheet.scss
Created February 6, 2019 23:19 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.1.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
###########################################
# Constants, set and forget
###########################################
# temp storage for the wordpress tarball
TMP_STORAGE=/home/USER/wptemp
# web root for the wordpress site
WWWROOT=/var/www
# Privileged db use/pwd for creating database and granting rights
<?php
global $elementor_widget_blacklist;
$elementor_widget_blacklist = [
// 'common'
// ,'heading'
// ,'image'
// ,'text-editor'
// ,'video'
<?php
namespace Deployer;
use Automate\CloudwaysApiClient;
require_once __DIR__ . '/vendor/autoload.php';
require 'recipe/common.php';
// Functions
newconomy.media:
stage: production
domain_local: newconomy.test
local_protocol: https:
domain_remote: newconomy.media
remote_protocol: https:
deploy_path: ~/.deploy
domain_folder: ~/applications/zjdkjmgnqz/public_html
hostname: 35.177.47.151
user: master_wccfzhzmqb
@zorca
zorca / wordpress.sh
Created March 12, 2019 16:52 — forked from durvalrafael/wordpress.sh
Wordpress permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@zorca
zorca / parse_version_numbers.php
Created March 14, 2019 10:00 — forked from stevenrombauts/parse_version_numbers.php
Parse version numbers into major/minor/patch values
<?php
$versions = array('1.0 RC1', '1.0 RC2', '1.0 RC3', '1.0 RC4', '1.0 RC5', '1.0 RC6', '1.5.0', '1.5.1', '1.5.10', '1.5.11', '1.5.12', '1.5.13', '1.5.14', '1.5.15', '1.5.2', '1.5.3', '1.5.4', '1.5.5', '1.5.6', '1.5.7', '1.5.8', '1.5.9', '1.6.0', '1.6.1', '1.6.2', '1.6.3', '1.6.4', '1.6.5', '1.6.6', '1.6.7', '5.3.5-1ubuntu7.11', '2.14 RC1', '3.12RC5');
foreach($versions as $version)
{
$result = preg_match("/^(\d+)\.(\d+)[\. \-]?([a-z0-9\-\.]+)$/i", $version, $matches);
if($result)
{
$major = (int) $matches[1];