sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// custom mapbopx-gl-draw mode that modifies draw_line_string | |
// shows a center point, radius line, and circle polygon while drawing | |
// forces draw.create on creation of second vertex | |
import MapboxDraw from 'mapbox-gl-draw'; | |
import numeral from 'numeral'; | |
import lineDistance from 'npm:@turf/line-distance'; | |
const RadiusMode = MapboxDraw.modes.draw_line_string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require dirname(__DIR__) . '/vendor/autoload.php'; | |
$loop = React\EventLoop\Factory::create(); | |
$pusher = new Pusher; // Create a Pusher class that implements Ratchet\Wamp\WampServerInterface | |
// The loop | |
// Binding to 127.0.0.1 means the only client that can connect is itself. | |
// To accept remotes we should bind to 0.0.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
/** | |
* Media Uploader | |
*/ | |
var media_uploader = null; | |
function open_media_uploader_video(img, field) { | |
media_uploader = wp.media({ | |
title: 'Select or Upload Media', | |
button: { | |
text: 'Use this media' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove Yoast SEO Change existing title or meta template variable | |
* Credit: Moshe Harush | |
* https://stackoverflow.com/questions/36281915/yoast-seo-how-to-create-custom-variables | |
* Last Tested: Unknown | |
*/ | |
// define the wpseo_replacements callback | |
function filter_wpseo_replacements( $replacements ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Download zeromq | |
# Ref http://zeromq.org/intro:get-the-software | |
wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz | |
# Unpack tarball package | |
tar xvzf zeromq-4.2.2.tar.gz | |
# Install dependency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// --------------------------------------- | |
// packages | |
// --------------------------------------- | |
const del = require("del"); | |
const deleteEmpty = require("delete-empty"); | |
const globby = require("globby"); | |
const gulp = require("gulp"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_added_to_cart_notice() | |
{ | |
$notices = WC()->session->get('wc_notices', array()); | |
foreach( $notices['success'] as $key => &$notice){ | |
if( strpos( $notice, 'has been added' ) !== false){ | |
$added_to_cart_key = $key; | |
break; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = file_get_contents('/wp-content/themes/themename/analyzers.csv'); | |
$lines = explode(PHP_EOL, $file); | |
$array = array(); | |
foreach ($lines as $line) { | |
$l = str_getcsv($line); | |
$array[] = array( | |
'brand' => $l[1], | |
'model' => $l[0], | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JS | |
var ajaxcontent = $('.products'); | |
$.ajax({ | |
type: 'POST', | |
url: window.wp_data.ajax_url, | |
data: { | |
action: "loadPosts", | |
}, | |
success: function (html) { |