Skip to content

Instantly share code, notes, and snippets.

View Basilakis's full-sized avatar
🏠
Working from home

Basilis Kanonidis Basilakis

🏠
Working from home
View GitHub Profile
@Basilakis
Basilakis / helpscout-docs-to-csv.js
Created March 16, 2021 17:14 — forked from rosinghal/helpscout-docs-to-csv.js
Import helpscout docs to CSV
const Axios = require("axios");
const { createObjectCsvWriter } = require("csv-writer");
const HELPSCOUT_API_KEY = "<<YOUR_HELPSCOUT_API_KEY>>";
const helpscoutInstance = Axios.create({
baseURL: "https://docsapi.helpscout.net/v1",
auth: {
username: HELPSCOUT_API_KEY,
password: "X"

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@Basilakis
Basilakis / wp-update.sh
Created December 18, 2020 18:23 — forked from pacoorozco/wp-update.sh
Backup and update a Wordpress Site using wp-cli
#!/usr/bin/env bash
##########################################################################
# Shellscript: Backup and update WordPress using wp-cli
# Author : Paco Orozco <paco@pacoorozco.info>
# Requires : wp-cli
##########################################################################
# Changelog
# 20170125: 1.0
# Adds a default option to upgrade only when it's needed.
# 20161220: 0.1
@Basilakis
Basilakis / linkedin-unfollow-everyone.js
Created October 27, 2020 15:18 — forked from brunolemos/linkedin-unfollow-everyone.js
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@Basilakis
Basilakis / acf_repeater_shortcode.php
Created September 23, 2020 20:30 — forked from FranciscoG/acf_repeater_shortcode.php
An Advanced Custom Fields shortcode that allows to loop through a field with a repeater. This only handles simple cases, it can't handle nested repeater fields
<?php
/**
* ACF Pro repeater field shortcode
*
* I created this shortcode function because it didn't exist and it was being requested by others
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/
*
* @attr {string} field - (Required) the name of the field that contains a repeater sub group
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
@Basilakis
Basilakis / functions.php
Created May 24, 2020 11:52
Get eventsON Related Events Further Details for Locations
// Related Events @+2.8
case 'relatedEvents':
$events = $EVENT->get_prop('ev_releated');
$events = !empty($events)? json_decode($events, true): false;
if($events && is_array($events)){
ob_start();
?>
<div class='evo_metarow_rel_events evorow bordb evcal_evdata_row'>
@Basilakis
Basilakis / single.php
Last active April 15, 2020 08:29
Check if WooCommerce Restrict Content user has Membership
<?php
/*
* More Refrences: https://docs.woocommerce.com/document/woocommerce-memberships-admin-hook-reference/
* Function that checked if user has access to this specific content
* Usage: if(can_user_access_content(get_current_user_id(),$post->ID)){ }
*/
function can_user_access_content($user_id,$post_id){
//check if there's a force public on this content
if(get_post_meta($post_id,'_wc_memberships_force_public',true)=='yes') return true;
$args = array( 'status' => array( 'active' ));
@Basilakis
Basilakis / functions.php
Last active March 27, 2020 09:23
Add Product Weight to WooCommerce Emails
add_action( 'woocommerce_order_item_meta_end', 'ts_order_item_meta_end', 10, 4 );
function ts_order_item_meta_end( $item_id, $item, $order, $plain_text, $product ){
global $product;
$product = wc_get_product();
echo $product->get_weight();
}
@Basilakis
Basilakis / wc-admin-new-order-email-change-subject.php
Last active February 27, 2020 22:06 — forked from bekarice/wc-admin-new-order-email-change-subject.php
Add customer name to WooCommerce Admin New Order Email subject
// Adds customer first and last name to admin new order email subject
function skyverge_add_customer_to_email_subject( $subject, $order ) {
$subject = 'New Customer Order - (# ' . $order->get_order_number() . ') from ' . $order->get_billing_first_name() . ' ' . $order->get_billing_last_name();
return $subject;
};
add_filter( 'woocommerce_email_subject_new_order', 'skyverge_add_customer_to_email_subject', 10, 2 );
@Basilakis
Basilakis / cloudways-mautic.sh
Last active February 27, 2020 12:54 — forked from heathdutton/cloudways-mautic.sh
Recommended cron tasks for Mautic 2 in Cloudways.
# Recommended cron tasks for Mautic 2 in Cloudways.
# All tasks are ran as www-data
# Output is ignored to avoid log file overhead.
# --quiet is used to reduce MySQL overhead on some tasks.
# --max-contacts is used to prevent one object's backlog from locking updates for other object.
# SEGMENTS
# Update all segments.
*/5 * * * * php /home/master/applications/fwhtzfeudw/public_html/app/console mautic:segments:update --max-contacts=10000 --quiet >/dev/null 2>&1