Skip to content

Instantly share code, notes, and snippets.

View devellopah's full-sized avatar

Islam Ibakaev devellopah

  • 12:31 (UTC +03:00)
View GitHub Profile
@devellopah
devellopah / sane-caching.nginx.conf
Created November 26, 2019 16:55 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@devellopah
devellopah / default.conf
Created November 24, 2019 09:53
nginx config
server {
listen 80 default_server;
listen [::]:80 default_server;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
@devellopah
devellopah / docker-compose.yml
Created November 16, 2019 07:49
wordpress on docker
version: '3.3'
services:
db:
image: mysql:5.7.28
volumes:
- db_data:/var/lib/mysql
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci'
@devellopah
devellopah / install-docker.sh
Created June 2, 2019 23:28 — forked from sethbergman/install-docker.sh
Install Docker CE on Linux Mint 19
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@devellopah
devellopah / webpack.mix.js
Created March 14, 2018 20:04 — forked from andrewdelprete/webpack.mix.js
Laravel Mix: Tailwind CSS + PurgeCSS Example
let mix = require("laravel-mix");
let tailwindcss = require("tailwindcss");
let glob = require("glob-all");
let PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
@devellopah
devellopah / gist:ba26451d48cf17dfdec2c6623be02e7d
Created March 7, 2018 22:26 — forked from mikejolley/gist:2044109
WooCommerce - Update number of items in cart and total after Ajax
<?php
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );
function woocommerce_header_add_to_cart_fragment( $fragments ) {
ob_start();
?>
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
<?php
$args = array(
'number' => $number,
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'include' => $ids
);
$product_categories = get_terms( 'product_cat', $args );
$count = count($product_categories);
@devellopah
devellopah / urls
Last active February 25, 2018 17:11
<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>
<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>
<?php echo get_permalink( wc_get_page_id( 'cart' ) ); ?>
<?php echo get_permalink( wc_get_page_id( 'checkout' ) ); ?>
@devellopah
devellopah / functions.php
Created February 25, 2018 16:09 — forked from kontikidigital/functions.php
WooCommerce: Change Select Options Button Text for variable products
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/**
* custom_woocommerce_template_loop_add_to_cart
*/
function custom_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->product_type;
switch ( $product_type ) {
2018-01-29 16:14:26 81.24.87.129
Table 'byb.wa_app_settings' doesn't exist
## wa-system/database/waDbMysqliAdapter.class.php(292)
#0 wa-system/database/waDbMysqliAdapter.class.php(168): waDbMysqliAdapter->exception()
#1 wa-system/database/waModel.class.php(171): waDbMysqliAdapter->schema('wa_app_settings', false)
#2 wa-system/database/waModel.class.php(127): waModel->describe()
#3 wa-system/database/waModel.class.php(97): waModel->getFields()
#4 wa-system/database/waModel.class.php(77): waModel->getMetadata()
#5 wa-system/contact/waContact.class.php(67): waModel->__construct()