Skip to content

Instantly share code, notes, and snippets.

View tkjaergaard's full-sized avatar

Thomas Kjærgaard tkjaergaard

View GitHub Profile
@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);
<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 / 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 );
<?php spl_autoload_register(function($c){@include preg_replace('#\\\|_(?!.+\\\)#','/',$c).'.php';});
@tkjaergaard
tkjaergaard / Preferences.sublime-settings
Created May 31, 2013 10:23
Preferences.sublime-settings
{
"color_scheme": "Packages/User/Laravel.tmTheme",
"detect_indentation": false,
"font_size": 19.0,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 7,
"line_padding_top": 7,
# All colors must be in the form of '#rrggbb' or '#rgb'.
# You cannot use color names.
log-view:
nickname-format: '%n'
input-text:
font-family: 'Lucida Grande, Tahoma, Verdana, Arial, sans-serif'
font-size: 11.0
background-color: '#232323'
color: '#ffffff'
html {
font-family: "Dejavu Sans Mono", "Monaco", monospace;
font-size: 9pt;
background-color: #2b2b2b;
color: #FFFFFF;
padding: 0;
margin: 0;
}
body {
@tkjaergaard
tkjaergaard / index.js
Created October 15, 2013 13:54
Fluent-ffmpeg test
var ffmpeg = require('fluent-ffmpeg'),
express = require('express');
var app = express();
app.get('/video/:filename', function(req, res) {
res.contentType('ogg');
var pathToMovie = 'video/' + req.params.filename; // be-s1e1.avi
@tkjaergaard
tkjaergaard / functions.php
Created December 3, 2013 11:55
Worpress slider using nav_menu
<?php
// [...]
if( !function_exists('get_thumb_url') )
{
function get_thumb_url($size='thumbnail',$id=null)
{
$id = ( $id ?: get_post()->ID );
@tkjaergaard
tkjaergaard / Vagrantfile
Last active December 31, 2015 09:19
Simple Vagrantfile for quick setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"