Skip to content

Instantly share code, notes, and snippets.

View gcsecsey's full-sized avatar
:shipit:
On a shipping spree

Gergely Csécsey gcsecsey

:shipit:
On a shipping spree
View GitHub Profile
@gabrielmerovingi
gabrielmerovingi / mycred-woo-coupon
Last active June 28, 2020 15:19
This custom shortcode allows your users to convert their myCRED points into a WooCommerce coupon, in order to give themselves a discount or partial payment on their order. In order for this to work, you need to set an exchange rate between points and your store currency and select. Requires myCRED 1.6+ and WooCommerce 2.4+
/**
* Convert myCRED Points into WooCommerce Coupon
* Requires myCRED 1.4 or higher!
* @version 1.3.1
*/
add_shortcode( 'mycred_to_woo_coupon', 'mycred_pro_render_points_to_coupon' );
function mycred_pro_render_points_to_coupon( $atts, $content = NULL ) {
// Users must be logged in
if ( ! is_user_logged_in() )
@JonathanTech
JonathanTech / InstallWindowsFeatures.bat
Last active June 9, 2019 13:33
My Current install batch for Chocolatey
choco windowsfeatures TelnetClient
choco windowsfeatures WindowsGadgetPlatform
choco windowsfeatures IIS-WebServerRole
choco windowsfeatures IIS-WebServer
choco windowsfeatures IIS-CommonHttpFeatures
choco windowsfeatures IIS-HttpErrors
choco windowsfeatures IIS-ApplicationDevelopment
choco windowsfeatures IIS-Security
choco windowsfeatures IIS-URLAuthorization
choco windowsfeatures IIS-RequestFiltering
@bradp
bradp / setup.sh
Last active July 24, 2024 15:55
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@mikaelz
mikaelz / functions.php
Last active January 26, 2022 11:03
WooCommerce auto-update cart when quantity changed, relates with https://gist.github.com/mikaelz/418a337dace188ba95b476ce65abfe0c
/**
* Auto update cart after quantity change
*
* @return string
**/
add_action( 'woocommerce_after_cart', 'custom_after_cart' );
function custom_after_cart() {
echo '<script>
jQuery(document).ready(function($) {
@gwillem
gwillem / magento-nginx.conf
Last active July 29, 2023 10:13
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
@epixoip
epixoip / 8x1080.md
Last active July 17, 2024 08:17
8x Nvidia GTX 1080 Hashcat Benchmarks
@EricBusch
EricBusch / product_discount_sorting_and_displaying.php
Last active November 6, 2022 11:05
This code adds a "discount" to catalog ordering args. It makes it possible for a user to order products on WooCommerce category pages and the main shop page by the product's discount amount. It also adds a "'Sort by discount" to sorting menus on shop page and category pages. Finally it displays the percentage you save on a discounted item. This …
<?php
/**
* Add "discount" to catalog ordering args.
*
* This makes it possible for a user to order products on category pages and the main shop
* page by the product's discount amount.
*
* @see wc_clean()
* @link http://docs.woothemes.com/document/custom-sorting-options-ascdesc/
@sadikay
sadikay / google_fonts.css
Created April 26, 2017 22:34
All Google Fonts In One CSS File
@font-face {
font-family: 'ABeeZee';
font-style: normal;
font-weight: 400;
src: local('ABeeZee'), local('ABeeZee-Regular'), url(http://fonts.gstatic.com/s/abeezee/v9/JYPhMn-3Xw-JGuyB-fEdNA.ttf) format('truetype');
}
@font-face {
font-family: 'Abel';
font-style: normal;
font-weight: 400;
@jessfraz
jessfraz / boxstarter.ps1
Last active July 7, 2024 22:46
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@whoisryosuke
whoisryosuke / adding-prettier-to-projects.md
Last active August 30, 2021 10:27
Workflow - Adding ESLint (Airbnb) + Prettier to projects
# Install ESLint and Babel ESLint
# Make sure to install at least v5.1.0 of ESLint
npm install --save-dev eslint babel-eslint

# Install the Airbnb configs (3 of them, listed below)
npx install-peerdeps --dev eslint-config-airbnb

# Install Prettier + ESLint config
npm install --save-dev --save-exact prettier eslint-config-prettier