Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{
@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 ) {
@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%);
}
@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"},
@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(':');
<?php
/*
* Podcast URL Extractor
* implemented at http://itunes.so-nik.com
*
* All code has been re-written by lasavior.
* Original code & inspiration from Michael Sitarzewski, zerologic.com
*
* Ex: http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewPodcast?id=269238657
@benrolfe
benrolfe / itunes-byte-request.php
Last active July 10, 2018 21:40
iTunes have recently requested that podcast downloads accept "byte range requests". This PHP code below will set the correct headers and serve up the MP3 file. Set $file_path to the path of the MP3 file. See http://blog.unit6websites.com/post/48778214025/byte-range-requests
<?php
$fp = @fopen( $file_path, 'rb' );
$size = filesize( $file_path );
$length = $size;
$start = 0;
$end = $size - 1;
header( "Accept-Ranges: 0-$length" );
@tinabeans
tinabeans / template.html
Last active February 13, 2024 09:18
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@jacrook
jacrook / font_variables.scss
Last active June 16, 2024 18:15
Sass Css Font Stack Variables
//////////////////////////////////////////////////////////////
// Font Variables (http://cssfontstack.com/)
//////////////////////////////////////////////////////////////
//
// Serif font-stacks
//
$baskerville-font-stack: "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif !default;
@vsoch
vsoch / index.php
Last active June 2, 2024 14:28
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";