Skip to content

Instantly share code, notes, and snippets.

View LiangRenDev's full-sized avatar

Liang LiangRenDev

View GitHub Profile
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@mikejolley
mikejolley / gist:cd67b0baf1c3767bb29f76471fea120b
Last active September 13, 2021 20:45
WooCommerce - Add all upsells of a product to the cart via custom link
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
* Product must have upsells, and this works with simple products only.
* Example link: yoursite.com?add-upsells-to-cart=X, X being your product ID.
*/
add_action( 'wp_loaded', 'bulk_upsell_add_to_cart_action', 20 );
function bulk_upsell_add_to_cart_action() {
@gaearon
gaearon / modern_js.md
Last active April 14, 2025 19:22
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav