Skip to content

Instantly share code, notes, and snippets.

View ihranova's full-sized avatar
:electron:
Always improving

Ina Hranova ihranova

:electron:
Always improving
  • Pernik, Bulgaria
View GitHub Profile
@ihranova
ihranova / mern-server-setup.md
Created March 14, 2023 14:18 — forked from bradtraversy/mern-server-setup.md
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

add_filter( 'woocommerce_email_attachments', 'attach_invoice_to_mail', 10, 4 );
function attach_invoice_to_mail( $attachments, $email_id, $order, $email ) {
$email_ids = array( 'customer_completed_order' );
if ( in_array ( $email_id, $email_ids ) ) {
if ( $invoice_id = get_post_meta( $order->get_id(), 'woo_bg_order_document', 1 ) ) {
$attachments[] = get_attached_file( $invoice_id );
}
}
@ihranova
ihranova / node_nginx_ssl.md
Created December 19, 2021 16:50 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@ihranova
ihranova / dequeue-tribe-events-styles-scripts.php
Created December 1, 2020 15:58 — forked from samkent/dequeue-tribe-events-styles-scripts.php
Dequeue Tribe Events (The Events Calendar) scripts and styles if not calendar or event page
<?php
/**
* Detect Tribe Events page
* @link https://wordpress.stackexchange.com/questions/340515/writing-a-function-to-detect-an-event
*/
function is_tribe_calendar() {
if (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular( 'tribe_events' )) {
return true;
}
else {
@ihranova
ihranova / repeatable-fields-metabox.php
Created February 20, 2019 18:17 — forked from helen/repeatable-fields-metabox.php
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@ihranova
ihranova / Steps Sprite Animation.markdown
Last active September 14, 2015 17:03
Steps Sprite Animation
@ihranova
ihranova / Steps Sprite Animation.markdown
Created September 14, 2015 16:53
Steps Sprite Animation