Skip to content

Instantly share code, notes, and snippets.

View herrbischoff's full-sized avatar

Marcel Bischoff herrbischoff

View GitHub Profile
@herrbischoff
herrbischoff / .htaccess
Created April 8, 2015 21:56
Redirect all pages to index
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
cursor url(cursor1.svg), auto
@herrbischoff
herrbischoff / monospace.styl
Created April 8, 2015 21:59
Monospace font definition
.monospaced
font-family Menlo, Courier, Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace
-webkit-hyphens auto
-moz-hyphens auto
hyphens auto
@herrbischoff
herrbischoff / center.styl
Created April 8, 2015 22:00
Absolute center
.absolute-center
// height must be declared
margin auto
position absolute
top 0
left 0
bottom 0
right 0
@herrbischoff
herrbischoff / api.php
Last active August 29, 2015 14:18
Simple WordPress XML API
<?php
$id = intval($_GET['id']);
require_once "../../../wp-load.php";
$args = array( 'numberposts' => 5 );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post);
$vimeo = get_post_meta($post->ID, 'vimeo_url', true);
@herrbischoff
herrbischoff / userlevel.php
Created April 8, 2015 22:04
Show WordPress Content By User Level
<?php if (current_user_can('level_10')) : ?>
<?php print "control the world"; ?>
<?php elseif (current_user_can('level_7')) : ?>
<?php print "edit, write, publish, delete, read, comment"; ?>
<?php elseif (current_user_can('level_4')) : ?>
<?php print "write, publish, delete, read, comment"; ?>
<?php elseif (current_user_can('level_2')) : ?>
<?php print "write, read, comment"; ?>
<?php elseif (current_user_can('level_0')) : ?>
<?php print "read and comment"; ?>
@herrbischoff
herrbischoff / vimeo-thumbnail.php
Created April 8, 2015 22:08
Get Vimeo Video Thumbnail
function getVimeoVideoThumbnail($id) {
$hash = unserialize( file_get_contents("http://vimeo.com/api/v2/video/$id.php") );
$thumbnail = $hash[0]['thumbnail_large'];
return $tumbnail;
}
@herrbischoff
herrbischoff / link-youtube.php
Created April 8, 2015 22:09
Linkify YouTube Video
@herrbischoff
herrbischoff / opengraph.php
Created April 8, 2015 22:11
Facebook OpenGraph Tags
<!-- Facebook OpenGraph tags -->
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:locale" content="de_DE" />
<meta property="og:type" content="website" />
<meta property="og:image" content="<?php bloginfo('template_url') ?>/screenshot.png" />
<meta property="og:url" content="<?php bloginfo('url'); ?>"/>
<meta property="og:title" content="<?php bloginfo('name'); ?>" />