Skip to content

Instantly share code, notes, and snippets.

View niamrox's full-sized avatar

Niamul Hasan niamrox

View GitHub Profile
@nielslange
nielslange / README.md
Last active July 4, 2017 11:19
WooCommerce snippets
@jaredatch
jaredatch / functions.php
Last active July 3, 2023 23:10
WordPress Search Autocomplete using admin-ajax.php
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@xrstf
xrstf / letsencrypt.md
Last active April 18, 2023 05:01
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@goranefbl
goranefbl / gist:6cfda8683069b16eaeb6
Created October 7, 2015 14:13
Woocommerce Shortcodes
<?php
/**
* Shortcodes init
*
* Init main shortcodes, and add a few others such as recent products.
*
* @author WooThemes
* @category Shortcodes
* @package WooCommerce/Shortcodes
* @version 1.6.4
<?php
/**
* Get all type posts
*
* @return void
* @author alispx
**/
function alispx_get_type_posts_data( $post_type = 'post' ) {
@rahul286
rahul286 / wpcommon.conf
Created April 25, 2015 15:20
EDD downloads security with EasyEngine
# For more details, refer - https://easydigitaldownloads.com/support/topic/download-files-not-protected-nginx-under-easyengine/
# NOT tested (yet)
location /wp-content/uploads/ {
location ~ ^/wp-content/uploads/edd/(.*?)\.zip$ {
rewrite / permanent;
}
location ~ \.php$ {
#Prevent Direct Access Of PHP Files From Web Browsers
@jchamb
jchamb / gist:fdf7d12b0191cb852056
Last active July 25, 2023 16:59
Woocommerce Free Downloads without checkout
function direct_free_downloads_button($button)
{
global $product;
if( $product->is_downloadable() AND $product->get_price() == 0 )
{
$files = $product->get_files();
$files = array_keys($files);
$download_url = home_url('?download_file='.$product->id.'&key='.$files[0].'&free=1' );
@rcotrina94
rcotrina94 / How to use Images as Radio buttons.md
Last active February 22, 2024 13:29
How to use images for radio buttons (input-radio).