Skip to content

Instantly share code, notes, and snippets.

Avatar

Emil Stahl emilstahl

View GitHub Profile
@emilstahl
emilstahl / twilio-make-call.php
Last active Aug 29, 2015
Make a call with PHP and the Twilio REST API.
View twilio-make-call.php
<?php
// Include Twilio PHP library
require 'Services/Twilio.php';
// Twilio REST API version
$version = "2010-04-01";
// AccountSid and AuthToken
$sid = 'AC4a5463a2b9db0755e9c668b8b117fb91';
$token = 'f86d4aa9e8c17cafa80cd88de7594716';
@emilstahl
emilstahl / resizeimages.php
Created Apr 7, 2014
Resize WordPress wp-content images.
View resizeimages.php
<?php
/*
Recursive Image Resizer (For Wordpress) 1.0
By Frands B. Hansen <fbh@helpsoft.dk>
Copyright (c) 2013, Frands B. Hansen
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@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
@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 / 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' );
}
}
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 / 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 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 / 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);
@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;
}