Skip to content

Instantly share code, notes, and snippets.

View jeremysu0131's full-sized avatar

Jeremy jeremysu0131

  • Taiwan
View GitHub Profile
@tetsuok
tetsuok / answer_word_count.go
Created April 2, 2012 02:20
An answer of the exercise: Maps on a tour of Go
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
m := make(map[string]int)
a := strings.Fields(s)
@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
'use strict';
function BinarySearchTree() {
this.root = null;
}
BinarySearchTree.prototype.insertNode = function (val) {
var node = {
data : val,
@trandaison
trandaison / starUML.md
Last active July 22, 2024 16:02
Get full version of StarUML
@Garconis
Garconis / woocommerce-category-toggle.css
Last active September 27, 2023 03:26
WooCommerce | Expand and collapse child categories with custom toggle in the sidebar widget | https://i.gyazo.com/e1a39ed551096444134324bb429722bb.mp4
/* - woo cat toggling elements, injected via jQuery - */
/* make list item be relative, to be able to position toggle within this item, if desired */
#sidebar .widget_product_categories ul.product-categories > li.cat-parent {
position: relative;
}
/* the new toggle element wrapper, which is added via jQuery */
#sidebar .widget_product_categories ul.product-categories > li.cat-parent .woo-cat-toggle {
cursor: pointer;
display: inline-block;
@nczz
nczz / woocommerce_quick_checkout.php
Last active September 12, 2022 08:06
WooCommerce 商品快速結帳按鈕
function mxp_woocommerce_after_add_to_cart_button(){
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
echo '<div id="ks_quick_checkout"><a href="'.$checkout_url.'?add-to-cart='.get_queried_object_id().'" class="button alt">直接結帳</a></div>';
?>
<script>
jQuery(document).ready(function() {
var v_product = jQuery('form.variations_form.cart').data();
if (v_product === undefined) {
return;