Skip to content

Instantly share code, notes, and snippets.

View maxxscho's full-sized avatar
🏠
Working from home

Markus Schober maxxscho

🏠
Working from home
View GitHub Profile
@maxxscho
maxxscho / firstday_of_week.php
Created October 24, 2012 14:37
PHP - Get first day of a given week
$week = 43;
$timestamp = mktime(0, 0 ,0, 1, 1, $this->year) + ($week * 7 * 24 * 60 * 60);
$timestamp_for_monday = $timestamp - 86400 * ( date( 'N', $timestamp) - 1 );
$first_day_of_week = date('d.m.Y', $timestamp_for_monday);
@maxxscho
maxxscho / widget_base.php
Created October 2, 2012 10:13
WORDPRESS: Widget base structure
<?php
class YourClassName extends WP_Widget {
public function YourClassName()
{
// Widget Options
$widget_ops = array(
'classname' => 'yourclassname',
'description' => 'Your description'
@maxxscho
maxxscho / Form_helper.php
Created August 21, 2012 08:27
Twitter Bootstrap Form Helper
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Generates the HTML for a Twitter Bootstrap Input
*
* @var string
* @author Markus Schober
**/
if ( !function_exists('tb_horizontal_input')) {
@maxxscho
maxxscho / toolbar-hooks.php
Created June 19, 2012 17:33 — forked from thefuxia/toolbar-hooks.php
T5 Toolbar hooks: Adds a toolbar item with the current page hooks.
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Toolbar hooks
* Description: Adds a toolbar item with the current page hooks.
* Version: 2012.06.19
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
@maxxscho
maxxscho / style.css
Created March 11, 2012 10:47
CSS: text-indent - new Way
.ti {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
/* this is just the text-indent, no width, no height, no background image */
@maxxscho
maxxscho / functions.php
Created March 8, 2012 07:04
Wordpress: Remove unnecessary Headlinks
/* !-------- REMOVE UNNECESSARY HEADLINKS ------------------- */
/*------------------------------------------------------------ */
function bb_remove_headlinks() {
// remove simple discovery link
remove_action('wp_head', 'rsd_link');
// remove windows live writer link
remove_action('wp_head', 'wlwmanifest_link');
// remove the version number
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'start_post_rel_link');
@maxxscho
maxxscho / EmptyWidget.php
Created March 7, 2012 10:24 — forked from jonathonbyrdziak/CustomWidgetFile.php
Wordpress: Plugin code to create a single widget in wordpress.
<?php
/**
* @package RedRokk
* @version 1.0.0
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Empty_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@maxxscho
maxxscho / functions.php
Created March 7, 2012 10:19
Wordpress: Body Class (functions.php)
/* !-------- BODY-TAG BROWSER CLASSES ------------------- */
/*------------------------------------------------------------ */
function bb_browser_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'browser-lynx';
elseif($is_gecko) $classes[] = 'browser-gecko';
elseif($is_opera) $classes[] = 'browser-opera';
elseif($is_NS4) $classes[] = 'browser-ns4';
elseif($is_safari) $classes[] = 'browser-safari';
@maxxscho
maxxscho / gist:1992354
Created March 7, 2012 10:08
CSS: Clearing (from Skeleton)
/* CLEARING
============================================================================ */
/* Self Clearing Goodness */
.container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }
/* Use clearfix class on parent to clear nested columns,
or wrap each row of columns in a <div class="row"> */
.clearfix:before,
.clearfix:after,
.row:before,
@maxxscho
maxxscho / Nginx configuration in Laravel Homestead for Craft
Last active September 20, 2015 18:30
Nginx configuration for Craft for speaking urls
## This is a possible configuration for nginx in Laravel Homestead for Craft