Skip to content

Instantly share code, notes, and snippets.

@SeanJA
SeanJA / time.php
Created November 28, 2012 23:17
put the characters in the right places
<?php
//made up x start positions... obviously, I think they are a pixel offset?
//days
$text = $interval->format('%D');
imagettftext ($image , $font['size'] , $font['angle'] , 10 , $font['y-offset'] , $font['color'] , $font['file'], $text );
//separator
$text = $interval->format(':');
@mmorrison
mmorrison / Timezones
Created November 24, 2012 04:05
Timezone list
@timezones = [
{name: 'MIT', info: 'Midway Islands Time', seconds: -39600},
{name: 'MIT', info: 'Hawaii Standard Time', seconds: -36000},
{name: 'AKST', info: 'Alaska Standard Time', seconds: -32400},
{name: 'AKDT', info: 'Alaska Daylight Savings Time', seconds: -28800},
{name: 'PST', info: 'Pacific Standard Time', seconds: -28800},
{name: 'PDT', info: 'Pacific Daylight Savings Time', seconds: -25200},
{name: 'MST', info: 'Mountain Standard Time', seconds: -25200, country: "United States"},
{name: 'MDT', info: 'Mountain Daylight Savings Time', seconds: -21600},
{name: 'CST', info: 'Central Standard Time', seconds: -21600, country: "United States"},
@karlhorky
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
}
@abackstrom
abackstrom / functions.php
Created January 4, 2012 17:10
Support Markdown syntax in P2 posts and comments
<?php
// http://michelf.com/projects/php-markdown/extra/
require_once( dirname(__FILE__) . '/markdown-extra/markdown-extra.php' );
/**
* Format posts/comments with Markdown at display time. Only process
* blocks starting with \^md\s+.
**/
function p2mis_comment_markdown( $text ) {
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{