Skip to content

Instantly share code, notes, and snippets.

Avatar

Emil Stahl emilstahl

View GitHub Profile
View gist:e5f1cc25ab0a69a94d92
Verifying that +emilstahl is my openname (Bitcoin username). https://onename.com/emilstahl
@emilstahl
emilstahl / functions.php
Last active Aug 29, 2015
Hide shipping rates when free shipping is available
View functions.php
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 Feb 1, 2015
Remove HTML WordPress comments
View functions.php
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 Aug 29, 2015
Mail fra SKAT i spam
View skattefar.txt
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);
View gist:0ec7fd7ce24e0f7f3163
Betingelser for brug af Eovendos tjeneste
1. Vedtagelse af betingelser
1.1. Disse betingelser (herefter benævnt "Betingelserne") for brug af Eovendos tjeneste (herefter benævnt "Tjenesten") regulerer forholdet vedrørende brug af Tjenesten mellem dig som bruger og Eovendo.
1.2. Ved at fortsætte brugen af Tjenesten accepterer du Betingelserne. Såfremt du ikke accepterer Betingelserne, kan du ikke benytte Tjenesten.
1.3. Du skal være mindst 18 år for at anvende Tjenesten. Såfremt du ikke opfylder dette alderskrav, må du ikke benytte Tjenesten.
@emilstahl
emilstahl / ga.php
Last active Aug 29, 2015
Google Analytics by host
View ga.php
<?php
// Created by Emil Stahl on 09/08/14.
// Copyright (c) 2014 emilstahl.dk. All rights reserved.
$site = idn_to_utf8($host);
// Her indsætter du domænet og UA id'et fra Google Analytics
$UA = array('gadgetcentralen.dk' => 'UA-XXXXX', 'xxx.dk' => 'UA-XXXXX', 'zzz.dk' => 'UA-XXXXX');
?>
<script>
View keybase.md

Keybase proof

I hereby claim:

  • I am emilstahl on github.
  • I am emilstahl (https://keybase.io/emilstahl) on keybase.
  • I have a public key whose fingerprint is F25D 90D5 57AE 958B 6FBA 7B14 6CFF FE80 137C F1AC

To claim this, I am signing this object:

@emilstahl
emilstahl / index.php
Last active Aug 29, 2015
JetPack Non-Admin Removal
View index.php
add_action( 'admin_init', 'jetpack_nonadmin_removal_init');
function jetpack_nonadmin_removal_init() {
if( !is_admin || !current_user_can( 'manage_options' ) ) {
if(false !== strpos($_SERVER['REQUEST_URI'], '/wp-admin/admin.php?page=jetpack')){wp_redirect('/wp-admin/', 302);}
if(false !== strpos($_SERVER['REQUEST_URI'], '/wp-admin/admin.php?page=omnisearch')){wp_redirect('/wp-admin/', 302);}
remove_menu_page( 'jetpack' );
}
}
@emilstahl
emilstahl / print.html
Created Apr 18, 2014
Trigger browser to print page
View print.html
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<script type="text/javascript">
function Print(){
document.body.offsetHeight;window.print();
}
</script>
</head>
@emilstahl
emilstahl / list.txt
Created Apr 16, 2014
Domæner der starter på A med heartbleed
View list.txt
This file has been truncated, but you can view the full file.
2014-04-16 22:52:48 aahuset.dk SSL Connection Failed
2014-04-16 23:05:06 arildskov.dk SSL Connection Failed
2014-04-16 23:01:14 areyouready.dk Not Vulnerable
2014-04-16 23:04:28 art-n-image.dk Not Vulnerable
2014-04-16 23:02:19 antiqueshop.dk Not Vulnerable
2014-04-16 22:56:54 abra.dk Not Vulnerable
2014-04-16 22:53:36 ab-flytteforretning.dk Not Vulnerable
2014-04-16 23:05:00 asnames.dk Not Vulnerable
2014-04-16 23:00:57 andwin.dk Not Vulnerable