Skip to content

Instantly share code, notes, and snippets.

@emilstahl
emilstahl / functions.php
Last active August 29, 2015 14:27
WooCommece cost price custom field
// Cost price
add_action('woocommerce_product_options_pricing', 'cost_price');
function cost_price() {
woocommerce_wp_text_input(
array(
'id' => '_cost_price',
'class' => 'wc_input_price short',
'label' => __('Cost price', 'woocommerce').' ('.get_woocommerce_currency_symbol().')',
'type' => 'text',
)
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 2.7
@emilstahl
emilstahl / available.txt
Created April 26, 2015 18:37
Available three letter .dk domains
aay.dk
aew.dk
afe.dk
afq.dk
afw.dk
afx.dk
afy.dk
afz.dk
agq.dk
agz.dk
aay.dk
aew.dk
afe.dk
afq.dk
afw.dk
afx.dk
afy.dk
afz.dk
agq.dk
agz.dk
test
yolo
@emilstahl
emilstahl / jonas.sh
Created April 8, 2015 19:37
terminal ips
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
Verifying that +emilstahl is my openname (Bitcoin username). https://onename.com/emilstahl
@emilstahl
emilstahl / functions.php
Last active August 29, 2015 14:15
Hide shipping rates when free shipping is available
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
/* Hide shipping rates when free shipping is available */
function hide_shipping_when_free_is_available( $rates, $package ) {
// Only modify rates if free_shipping is present
if ( isset( $rates['free_shipping'] ) ) {
// To unset a single rate/method, do the following. This example unsets flat_rate shipping
unset( $rates['flat_rate'] );
}
return $rates;
@emilstahl
emilstahl / functions.php
Created February 1, 2015 15:51
Remove HTML WordPress comments
add_filter( 'comment_form_defaults', 'remove_comment_form_allowed_tags' );
function remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = '';
return $defaults;
}
@emilstahl
emilstahl / skattefar.txt
Last active August 29, 2015 14:09
Mail fra SKAT i spam
Delivered-To: emil@emilstahl.dk
Received: by 10.114.185.4 with SMTP id ey4csp54217ldc;
Mon, 10 Nov 2014 11:24:29 -0800 (PST)
X-Received: by 10.112.16.39 with SMTP id c7mr31266745lbd.19.1415647469719;
Mon, 10 Nov 2014 11:24:29 -0800 (PST)
Return-Path: <TastSelv@tastselvperson.skat.dk>
Received: from bounce.skat.dk (bounce.skat.dk. [147.29.109.227])
by mx.google.com with ESMTPS id c5si28388104lah.117.2014.11.10.11.24.29
for <emil@emilstahl.dk>
(version=TLSv1 cipher=RC4-SHA bits=128/128);