Skip to content

Instantly share code, notes, and snippets.

View 13122310958's full-sized avatar

eric 13122310958

View GitHub Profile
@13122310958
13122310958 / woocommerce.css
Created January 12, 2020 12:30 — forked from catchthemes/woocommerce.css
Make the WooCommerce Cart Table Responsive for Mobile Devices
/* START Make the WooCommerce Cart Table Responsive for Mobile */
/* CSS published in http://www.jeremycarter.com.au/optimising-woocommerce-checkout-for-mobile/ */
@media screen and (max-width: 600px) {
/* Force table to not be like tables anymore */
.woocommerce-page table.shop_table,
.woocommerce-page table.shop_table thead,
.woocommerce-page table.shop_table tbody,
.woocommerce-page table.shop_table th,
@13122310958
13122310958 / ClefButton.jsx
Created December 28, 2019 22:02 — forked from jessepollak/ClefButton.jsx
A React component to use the Clef button
//
// Requires:
//
// react-async-script-loader
//
import React, {Component} from 'react'
import ReactDOM from 'react-dom'
import scriptLoader from 'react-async-script-loader'
class ClefButton extends Component {
@13122310958
13122310958 / gravity-form.php
Created October 23, 2019 23:43 — forked from wkw/gravity-form.php
Custom: Gravity Forms WP API Submission and GF API form entry creation plus send notifications
<?php
/**
* Add WP API endpoint for form submission, then create new
* Gravity Forms entry and send notifications.
*/
// rest api endpoint for forms submission
add_action( 'rest_api_init', function () {
register_rest_route( 'ahr/v1', '/forms', array(
'methods' => 'POST',
@13122310958
13122310958 / gravityforms-modify-value-after-update.php
Created October 14, 2019 06:48 — forked from zackkatz/gravityforms-modify-value-after-update.php
Gravity Forms - Modify field value after updating in Gravity Forms OR GravityView
<?php
/**
* Modify a field value after updating an entry
*
* @param array $form Gravity Forms form object
* @param int $entry_id ID of the entry that was updated
* @param array $original_entry Original entry object, before update
*
* @return void
@13122310958
13122310958 / redirect-follower.py
Created October 10, 2019 02:41 — forked from FiloSottile/redirect-follower.py
Script to follow HTTP redirects and print the resulting URL - a.k.a. URL un-shortener
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import urllib2
# This script uses HEAD requests (with fallback in case of 405)
# to follow the redirect path up to the real URL
# (c) 2012 Filippo Valsorda - FiloSottile
# Released under the GPL license
@13122310958
13122310958 / nginxproxy.md
Created June 3, 2019 06:08 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@13122310958
13122310958 / dummy-web-server.py
Created May 18, 2019 06:39 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@13122310958
13122310958 / php-receive.php
Created October 4, 2018 10:46 — forked from hkulekci/php-receive.php
Rabbit MQ and PHP
<?php
/**
* Filename: php-receive.php
* Purpose: Receive messages from RabbitMQ server using AMQP extension
* Exchange Name: exchange1
* Exchange Type: fanout
* Queue Name: queue1
*/
$connection = new AMQPConnection();
$connection->setLogin("admin");
@13122310958
13122310958 / admin_filter_by_custom_fields.php
Created August 14, 2018 10:49 — forked from abrudtkuhl/admin_filter_by_custom_fields.php
WordPress Filter Posts By Custom Field Value In Admin
<?php
/*
Plugin Name: Admin Filter BY Custom Fields
Plugin URI: http://en.bainternet.info
Description: Filter posts or pages in admin by custom fields (post meta)
Version: 1.0
Author: Bainternet
Author URI: http://en.bainternet.info
*/