Skip to content

Instantly share code, notes, and snippets.

View bangsite's full-sized avatar

Bang bangsite

  • VN
  • 06:04 (UTC +07:00)
View GitHub Profile
@bangsite
bangsite / products_with_category.sql
Created May 8, 2019 02:23 — forked from phlbnks/products_with_category.sql
Select Product name, SKU, price and category from WordPress / WooCommerce with MySQL query
SELECT
wp_posts.post_title AS Product,
wp_postmeta1.meta_value AS SKU,
wp_postmeta2.meta_value AS Price,
GROUP_CONCAT( wp_terms.name ORDER BY wp_terms.name SEPARATOR ', ' ) AS ProductCategories
FROM wp_posts
LEFT JOIN wp_postmeta wp_postmeta1
ON wp_postmeta1.post_id = wp_posts.ID
AND wp_postmeta1.meta_key = '_sku'
LEFT JOIN wp_postmeta wp_postmeta2
@bangsite
bangsite / xampp_php7_xdebug.md
Created May 15, 2019 11:52 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

@bangsite
bangsite / hamburger-menu-animations.markdown
Created June 24, 2019 03:32
Hamburger Menu Animations
@bangsite
bangsite / meta-tags.md
Created October 2, 2019 08:44 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@bangsite
bangsite / responsive.css
Created March 22, 2020 10:07 — forked from codesynapse/responsive.css
Mobile responsive CSS
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@bangsite
bangsite / cloudSettings
Created April 27, 2020 16:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-27T16:37:43.339Z","extensionVersion":"v3.4.3"}
@bangsite
bangsite / Localhost Wordpress Permissions
Created June 16, 2020 03:49 — forked from shawnrgrimes/Localhost Wordpress Permissions
Enable updating WordPress in a local environment on OS X (Updates, Themes and Plugins)
On Mac OS X (Leopard+), the Apache HTTP Server runs under the user account, _www which belongs to the group _www. To allow WordPress to configure wp-config.php during installation, update files during upgrades, and update the .htaccess file for pretty permalinks, give the server write permission on the files.
One way to do this is to change the owner of the wordpress directory and its contents to _www. Keep the group as staff, a group to which your user account belongs and give write permissions to the group.
$ cd /<wherever>/Sites/<thesite>
$ sudo chown -R _www wordpress
$ sudo chmod -R g+w wordpress
This way, the WordPress directories have a permission level of 775 and files have a permission level of 664. No file nor directory is world-writeable.
@bangsite
bangsite / large-scale-vue.md
Created December 16, 2022 08:00
Large Scale Vue Application Structure

Large Scale Vue Application Structure

Application Structure LIFT Principle

  • Locating our code is easy
  • Identify code at a glance
  • Flat structure as long as we can
  • Try to stay DRY (Don’t Repeat Yourself) or T-DRY

"Folders-by-Feature" Structure

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@bangsite
bangsite / deploy_node_do.md
Created October 30, 2023 05:38 — forked from carlssonk/deploy_node_do.md
Deploy node.js app to DigitalOcean

Deploy Node.js Application to DigitalOcean

This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.

Prerequisites

Create Droplet & Generate SSH Key