Skip to content

Instantly share code, notes, and snippets.

View tkjaergaard's full-sized avatar

Thomas Kjærgaard tkjaergaard

View GitHub Profile
@tkjaergaard
tkjaergaard / thumb.php
Last active December 12, 2015 09:39
Simple Wordpress snippet to get a post thumbnail url
<?php
if( !function_exists('get_thumb_url') )
{
function get_thumb_url($size='thumbnail',$id=null)
{
$id = ( $id ?: get_post()->ID );
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($id), $size );
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
var PAYMILL_PUBLIC_KEY = '<DEIN_PAYMILL_PUBLIC_KEY>'; // live
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="https://bridge paymill de/"></script>
<script type="text/javascript">
@tkjaergaard
tkjaergaard / get.php
Created August 17, 2012 11:39
get attachment
public function get_attachments($id,$limit=FALSE,$type='prod')
{
if(!is_numeric($id)):
$this->error = 'We need a valid numeric ID number to get the attachments. provided: '.$id;
return false;
endif;
if( $limit && is_numeric($limit) ) $this->db->limit($limit);
@tkjaergaard
tkjaergaard / vali.js
Created July 10, 2012 07:31
Jquery validate function
function validateStep()
{
var validated = true
$('[id*="step"]:visible .error').removeClass('error');
$('[id*="step"]:visible .required :input').each(function(){
if( $(this).val().length <= 0 || !$(this).is(':checked') )
{
$(this).parent().addClass('error');
@tkjaergaard
tkjaergaard / qp2.php
Created May 10, 2012 11:41
QuickPay2
<?php
require_once('quickpay.php');
$params = array(
'msgtype' => 'recurring',
'merchant' => 89898978,
'ordernumber' => '00002377010419105206',
'amount' => 400,
'currency' => 'DKK',
@tkjaergaard
tkjaergaard / qp.php
Created May 10, 2012 11:14
QuickPay
<?php
$params = array(
'msgtype' => 'recurring',
'merchant' => 89898978,
'ordernumber' => 00002376630418111216,
'amount' => 400,
'currency' => 'DKK',
'autocapture' => 1,
'transaction' => 42309147,
<?php
require_once('xml.php');
$url = "https://secure.quickpay.dk/api";
$protocol = 4;
$msgtype = 'recurring';
$merchant = '89898978';
$ordernumber = 1334227428;
@tkjaergaard
tkjaergaard / style.css
Created February 28, 2012 22:49
Badminton App css
* {
margin:0;padding:0;
-moz-animation-duration: 3s;
-webkit-animation-duration: 3s;
animation-duration: 3s;
-webkit-animation-delay: 3s;
-moz-animation-delay: 3s;
animation-delay: 3s;
@tkjaergaard
tkjaergaard / app.js
Created February 28, 2012 22:30
badmintion app js
;(function($){
app = {
init: function(config) {
this.config = config;
$(config.wrapper).hide();
@tkjaergaard
tkjaergaard / index.html
Created February 28, 2012 21:58
Badminton App
<section class="wrap">
<article>
<div class="inner">
</div>
</article>
<article>
<div class="inner">