Skip to content

Instantly share code, notes, and snippets.

View moskalukigor's full-sized avatar

Ihor moskalukigor

View GitHub Profile
@SizableShrimp
SizableShrimp / README.md
Last active March 23, 2024 20:29
How to setup shading with Minecraft Forge

How to setup shading with Minecraft Forge

Shading is the concept of packing external dependencies inside your jar so that they exist in production. Without this, using external libraries would produce ClassNotFoundExceptions when you run your mod jar outside of an IDE. This guide explains how to setup shading through Gradle.

Assumptions

This guide assumes that:

  • You are on ForgeGradle 5 or higher
  • You are on Gradle 7.0 or higher
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active April 30, 2024 07:36
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@maciejbis
maciejbis / permalink-manager-qtranslatext.php
Last active September 22, 2023 21:00
Permalink Manager & qTranslate-XT support

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

@Keey
Keey / readme.txt
Last active March 18, 2019 10:06
optimize
0. Якшо сайт не наш - зробити скрін показників перед оптимізацією.
1. оптимізуєш картитнки ті які каже гугл.
2. ставиш плагін wp-fastest-cache(https://goo.gl/aRfrvR)
3. включаєш і провіряєш чи працює сайт.
4. ставиш і активуєш wp-fastest-cache-premium(https://drive.google.com/open?id=12Pe-Bf4kFvsIvx_mVpvEfMcfZ8KOZaSS) з архіву.
5. заходиш в налаштування плагіну і доставляєш всі галочки.
6. чистиш кеш в адмін барі в горі.
7. провіряєш чи працює сайт.
8. дивишся результати в гуглі.
9. якщо сайт не працює відключаєш всі галочки попорядку поки не запрацює(після кожної галочки незабувай чистити кеш).
@vovadocent
vovadocent / getTaxTermsByOtherTaxTerm.php
Last active October 4, 2017 14:00
Get Taxonomy Terms By Other Taxonomy Term
<?php
function getTaxTermsByOtherTaxTerm($taxonomy_args, $out_taxonomy, $post_type = NULL) {
global $wpdb;
$tax_q = $taxonomy_ids = array();
$post_type_q = !empty($post_type_q) ? "AND p.post_type = '$post_type'" : "";
foreach ($taxonomy_args as $tax => $term_id) {
$sql = "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt
INNER JOIN $wpdb->term_taxonomy t ON (t.term_id = tt.term_id AND tt.taxonomy = '$tax' AND t.term_id = $term_id)";
$taxonomy_ids = array_merge( $taxonomy_ids, $wpdb->get_col($sql) );
@dasbairagya
dasbairagya / function.php
Created May 1, 2017 05:18
short code to get the woocommerce recently viewed products
//short code to get the woocommerce recently viewed products
<?php function custom_track_product_view() {
if ( ! is_singular( 'product' ) ) {
return;
}
global $post;
if ( empty( $_COOKIE['woocommerce_recently_viewed'] ) )
$viewed_products = array();
@zorzv
zorzv / functions.php
Created February 3, 2017 19:15
Autocomplete Taxonomy Terms in Wordpress
//Custom Autocomplete
add_action('wp_ajax_nopriv_get_listing_names', 'ajax_listings');
add_action('wp_ajax_get_listing_names', 'ajax_listings');
function ajax_listings() {
global $wpdb; //get access to the WordPress database object variable
//get names of all taxonomy terms
$name = '%'.$wpdb->esc_like(stripslashes($_GET['name'])).'%'; //escape for use in LIKE statement
$sql = "SELECT term.term_id as id, term.name as post_title, term.slug as guid, tax.taxonomy FROM $wpdb->term_taxonomy tax
@Tusko
Tusko / eba.sh
Created January 22, 2017 10:31
Wordpress permissions / Terminal commands
find . -type f -exec chmod 644 {} +
find . -type d -exec chmod 755 {} +
#fix for wp-config.php and index.php
find . -name "wp-config.php" -exec chmod 444 {} +