Skip to content

Instantly share code, notes, and snippets.

View derpixler's full-sized avatar

DerPixler derpixler

View GitHub Profile
@derpixler
derpixler / validatemyform.js
Created February 17, 2012 11:06
a Simple js Form Validator
/**
* Ein ganz einfacher Formvalidator
*
* @autor Rene Reimann
* @package Meine toolbox
*/
jQuery(function($) {
$('#submitform').click( function(e){
@derpixler
derpixler / clipboardData.js
Created February 20, 2012 08:07
clipboardData
/*
* Das clientseitige clipboardData-Objekt beinhaltet Methoden die es ermöglichen auf die Zwischenablage
* zuzugreifen.
* Exsample:
* http://www.thisismoney.co.uk/money/mortgageshome/article-1671748/House-prices-What-expect--news-predictions.html
* Methoden
* clearData
* Die clearData-Methode ermöglicht das Leeren der Zwischenablage. Optional kann das Format als String angegeben
@derpixler
derpixler / gist:2028471
Created March 13, 2012 12:26 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@derpixler
derpixler / image_blur.html
Created October 15, 2012 06:38
Blur a Image
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>StackBlurForCanvas</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.js'></script>
<script type='text/javascript' src="http://www.quasimondo.com/StackBlurForCanvas/StackBlur.js"></script>
@derpixler
derpixler / multible.php
Created December 5, 2012 15:09
Get a list of multiple from int x
<?php
/**
* Get a list of multiple for 3 and 5 get
* the word Foo and Bar for both FooBar.
*
* @copyright (C) René Reimann | Mediengestaltung 2005-2012
* @version 1.0
*
* @author René Reimann info@rene-reimann.de
@derpixler
derpixler / mycustomposttype.php
Created May 10, 2013 09:44
Create Custom Posttypes with custom Taxonmies and Custom Metaboxes
<?php
/**
* Plugin Name: custom_post Postypes for WordPress
* Plugin URI:
* Description: Custom post type.
* Version: 1.0
* Author: Rene Reimann
* Author URI: www.rene-reimann.de
* Author Email: info@rene-reimann.de
@derpixler
derpixler / .htaccess
Created August 9, 2013 10:19
Apache Configuration File
# Apache Configuration File
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
# ##############################################################################
@derpixler
derpixler / current_currency_quota.php
Created September 5, 2013 06:24
Get Current Currency quota with the yahoo finance api
function getQuote($from, $to) {
$url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=l1&s='. $from . $to .'=X';
$curValue = trim(file_get_contents($url));
return $curValue;
}
echo '1 Euro = ' . getQuote('EUR', 'USD') .' USD<br/>';
echo '1 Euro = ' . getQuote('EUR', 'GBP') .' GBP<br/>';
@derpixler
derpixler / query-time.php
Created November 7, 2013 10:22
This function generates a json object with pre defined cities and their timezones.
<?php
header('Content-type: application/json');
$timezones = array(
array( 'Pacific/Samoa' => 'Samoa'),
array( 'Pacific/Honolulu' => 'Hawei'),
array( 'America/Anchorage' => 'Anchorage'),
array( 'America/Los_Angeles' => 'Los Angeles'),
array( 'America/Denver' => 'Denver'),
array( 'America/Indiana/Knox' => 'New Orleans' ),
@derpixler
derpixler / redirect_tracking_link.php
Last active December 29, 2015 16:18
A Simple Solution to add trackinglinks