Skip to content

Instantly share code, notes, and snippets.

View fuyuko's full-sized avatar

fuyuko

View GitHub Profile
@agusmu
agusmu / functions.php
Created July 24, 2013 08:42
WooCommerce - Adding category, excerpt, and SKU to shop page
/* Adding category, excerpt, and SKU to shop page */
add_action( 'woocommerce_after_shop_loop_item', 'prima_custom_shop_item', 5);
function prima_custom_shop_item() {
global $post, $product;
/* product categories */
$size = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
echo $product->get_categories( ', ', '<p>' . _n( 'Category:', 'Categories:', $size, 'woocommerce' ) . ' ', '.</p>' );
/* product excerpt */
@jboner
jboner / latency.txt
Last active November 19, 2024 11:10
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD