Skip to content

Instantly share code, notes, and snippets.

View Ricardo-Diaz's full-sized avatar

Ricardo Diaz Ricardo-Diaz

View GitHub Profile
@Ricardo-Diaz
Ricardo-Diaz / cpt-events-ical.php
Created December 14, 2015 20:26 — forked from maplesyrupsucker/cpt-events-ical.php
cpt-events-ical.php
<?php
// see: http://www.noeltock.com/web-design/wordpress/how-to-ical-with-custom-post-types/ for more info
//add to functions.php: load_template( dirname( __FILE__ ) . '/lib/cpt-events-ical.php' );
function tf_events_ical() {
// - start collecting output -
ob_start();
// - file header -
@Ricardo-Diaz
Ricardo-Diaz / front-page.php
Last active August 29, 2015 14:25 — forked from blogjunkie/front-page.php
Cache Metro Pro homepage with Transients API
<?php
//* Do NOT include the opening php tag shown above. Only modified code shown below.
function metro_homepage_widgets() {
// get the transient
$metro_homepage_content = get_transient( 'metro_homepage_content' );
// check if homepage content exists
if ( false === $metro_homepage_content ) :

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@Ricardo-Diaz
Ricardo-Diaz / r-debug.php
Last active August 29, 2015 14:15 — forked from Rarst/r-debug.php
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: MIT
*/
/**

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@import "compass/css3/shared";
// NOTE:
// All mixins for the 2009 spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
// indexing at 0.
// if `true`, the 2009 properties will be emitted as part of the normal mixin call
@main-font-size: 16px;
.x-rem (@property, @value) {
// This is a workaround, inspired by https://github.com/borodean/less-properties
@px-fallback: @value * @main-font-size;
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`;
-: ~`(function () { return ';@{property}: @{value}rem'; }())`;
}
@Ricardo-Diaz
Ricardo-Diaz / gist:4015433
Created November 5, 2012 05:02
SASS: Min/Max Breakpoint
$breakpoint-medium-not-wide: 500px 700px;
.baz {
@include breakpoint($breakpoint-medium-not-wide) {...}
@media (min-width: 500px) and (max-width: 700px) {.baz {...}}
@Ricardo-Diaz
Ricardo-Diaz / gist:4015430
Created November 5, 2012 05:01
SASS: Breakpoint
$breakpoint-medium-width: 500px;
.foo {
@include breakpoint($breakpoint-medium-width) {...}
}
@Ricardo-Diaz
Ricardo-Diaz / gist:4015279
Created November 5, 2012 04:10
CSS: Box Shadow Round Shadow effect both sides
rounded shadows to either side of the box.
The HTML
<div class="box effect8">
<h3>Effect 8</h3>
</div>
The CSS
.box h3{