Skip to content

Instantly share code, notes, and snippets.

View radscheit's full-sized avatar
🚀

Matthias Radscheit radscheit

🚀
View GitHub Profile
<?php
function wpb_admin_notice_warn()
{
$screen = get_current_screen();
write_log($screen->id);
$post_type_map = array(
"blogpost" => array("screen" => "edit-blogpost", "field" => "admin_notice_blogposts"),
"location" => array("screen" => "edit-location", "field" => "admin_notice_locations"),
"newsletter" => array("screen" => "edit-newsletter", "field" => "admin_notice_newsletter"),
switch($toolbox_type):
case "all":
$toolbox_icon = 'file-archive-o';
$toolbox_type_info = t('Gesamte Materialien');
$toolbox_detail = t('Stand: ') . date("d. m. Y",$toolbox_zip[0]['timestamp']) . ', ' . t('Gewicht: ') . number_format($toolbox_zip[0]['filesize'] / 1048576,2,'.',' ') . ' ' .t('MegaBytes');
break;
case "txt":
$toolbox_icon = 'file-text-o';
$toolbox_type_info = t('Texte');
$toolbox_detail = t('Dateien: ') . count($toolbox_file);
#include <iostream>
#include <cassert>
#include <cmath>
#include <stdlib.h>
#include <time.h>
#include <vector>
class Vector3d {
private:
double x_;
@radscheit
radscheit / jquery.affix.plugin
Created October 6, 2014 04:51
Ordentliche alternative Umsetzung des Bootstrap Affix From http://www.bluthemes.com/blog/7/dynamic-bootstrap-affix-fix
$(function(){ // name your elements here var stickyElement = '.stickyel', // the element you want to make sticky bottomElement = '.fakefooter'; // the bottom element where you want the sticky element to stop (usually the footer) // make sure the element exists on the page before trying to initalize if($( stickyElement ).length){ $( stickyElement ).each(function(){ // let's save some messy code in clean variables // when should we start affixing? (the amount of pixels to the top from the element) var fromTop = $( this ).offset().top, // where is the bottom of the element? fromBottom = $( document ).height()-($( this ).offset().top + $( this ).outerHeight()), // where should we stop? (the amount of pixels from the top where the bottom element is) // also add the outer height mismatch to the height of the element to account for padding and borders stopOn = $( d
@radscheit
radscheit / content-blocks.html
Last active August 29, 2015 14:07
KTB-Newsletter
<!-- ======= Datum ====== -->
<tr>
<td align="left" style="color: #333333; font-size: 16px; font-family: 'Roboto', Arial, sans-serif; line-height: 25px;" class="main-header title_color">
<div style="line-height: 25px">
<!-- ======= Datum bitte hier einfüllen====== -->
KW 40 / 2014
(function(){
 
var special = jQuery.event.special,
uid1 = 'D' + (+new Date()),
uid2 = 'D' + (+new Date() + 1);
 
special.scrollstart = {
setup: function() {
 
var timer,
@radscheit
radscheit / css_resources.md
Created May 2, 2014 16:23 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@radscheit
radscheit / javascript_resources.md
Created May 2, 2014 16:23 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@radscheit
radscheit / 0_reuse_code.js
Created May 2, 2014 16:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console