Skip to content

Instantly share code, notes, and snippets.

@wjiec
wjiec / open_default_browser.go
Last active November 5, 2019 15:54
微信直接打开默认浏览器
package main
import (
"log"
"net/http"
"strings"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, request *http.Request) {
@timelsass
timelsass / functions.php
Last active January 14, 2022 06:59
Add and use a new stock status in WooCommerce
<?php
/**
* This code adds a lowstock stock status to WooCommerce products. There is more code
* included here for examples of usage, such as hiding the lowstock status products from
* queries so they aren't displayed in shop pages,add badges to products, and update the
* availability messages on product pages.
*
* Please see this WordPress Stack Exchange question for more information and background:
*
* https://wordpress.stackexchange.com/questions/348759/exclude-products-with-a-stock-lower-than-the-low-stock-threshold-from-the-shop-l
@tungbt94
tungbt94 / vue-hide-keyboard-mobile.vue
Created July 11, 2018 03:36
Hide mobile keyboard on enter
<template>
<div class="hello">
<h1>{{ query }}</h1>
<input
ref="input"
v-model="query"
@focus="showMobileKeyboard"
@keyup.enter="hideMobileKeyboard"/>
</div>
</template>
@kittenlane
kittenlane / 1-remove-woocommerce-tabs.php
Last active August 5, 2025 09:39
Remove tabs but keep product description in WooCommerce
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/
// Location: add to functions.php
// Output: removes woocommerce tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
@DavidWells
DavidWells / add-wordpress-settings-page.php
Created January 28, 2013 05:59
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@olasitarska
olasitarska / pgessays.py
Created November 18, 2012 10:11
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <[email protected]>
Copyright: Licensed under the GPL-3 (http://www.gnu.org/licenses/gpl-3.0.html)
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
@Kevinlearynet
Kevinlearynet / Popular Posts This Month
Created October 8, 2012 13:52
Popular Posts Tracking
@electricg
electricg / fiddle.html
Created April 11, 2012 13:53
Geolocation and Flickr photos taken nearby - jQuery plugin
<figure class="flickr">
<figcaption></figcaption>
</figure>
@chrisguitarguy
chrisguitarguy / wp-registration-keys.php
Created August 30, 2011 20:28
Only lets users with an invite code register for a WordPress site.
<?php
/*
Plugin Name: WP Invite Codes
Plugin URI: http://pmg.co/
Description: Makes wordpress an invite only community.
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
*/