Skip to content

Instantly share code, notes, and snippets.

View mrcgrtz's full-sized avatar
:octocat:
I may be slow to respond.

Marc Görtz mrcgrtz

:octocat:
I may be slow to respond.
View GitHub Profile
@mrcgrtz
mrcgrtz / placeholder.js
Created April 21, 2010 10:29
Adds something like HTML5 placeholders when they are not supported by your browser. Usage: <input placeholder="Foobar">
var MyApp = {
addPlaceholders: function(props) {
// default configuration
var config = {
'class': 'placeholder' // apply CSS classes to an input displaying a placeholder
};
// if any properties were supplied, apply them to the config object
@mrcgrtz
mrcgrtz / country-list-german.html
Created April 21, 2010 20:14
German country SELECT element in HTML
<select name="country">
<option value="DE" selected>Deutschland</option>
<option value="AT">Österreich</option>
<option value="CH">Schweiz</option>
<optgroup label="A">
<option value="AF">Afghanistan</option>
<option value="EG">Ägypten</option>
<option value="AX">Åland</option>
<option value="AL">Albanien</option>
<option value="DZ">Algerien</option>
@mrcgrtz
mrcgrtz / buttons.css
Created April 23, 2010 11:38
Scalable CSS3 gradient buttons
/* @group Buttons */
button , .button {
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
cursor: pointer;
color: #fff;
background: #f60;
background: #f60 -moz-linear-gradient(top, #ff8f00, #ff4f00);
background: #f60 -webkit-gradient(linear, left top, left bottom, color-stop(0, #ff8f00), color-stop(1, #ff4f00));
@mrcgrtz
mrcgrtz / start.html
Created May 6, 2010 08:08
Valid HTML5 initial template with all possible omissions.
<!DOCTYPE html>
<meta charset=utf-8>
<title>Start</title>
@mrcgrtz
mrcgrtz / search.html
Created May 6, 2010 08:11
Safari-style search input field.
<input type="search" name="q" id="q" results="5" autosave="tld.yourdomain" placeholder="Type your search terms" autofocus>
@mrcgrtz
mrcgrtz / favicon.html
Created May 6, 2010 08:13
Get a favicon as PNG image via Google.
<img src="http://www.google.com/s2/favicons?domain=yourdomain.tld" width="16" height="16" alt="Favicon">
@mrcgrtz
mrcgrtz / hcalendar.html
Created May 6, 2010 08:27
HTML5 hCalendar snippet with Microformats and Microdata.
<section class="vevent" itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
<h1 class="summary" itemprop="summary"><a href="http://event.url/" class="url" itemprop="url" rel="bookmark">Event Title</a></h1>
<p class="description" itemprop="description">Event Description</p>
<ul>
<li>Datetime: <time class="dtstart" itemprop="dtstart" datetime="2010-05-06T19:00:00Z">May 6th @ 7pm</time> until <time class="dtend" itemprop="dtend" title="2010-05-06T21:00:00Z">9pm</time></li>
<li>Location: <span class="location" itemprop="location">Location</span></li>
</ul>
</section>
@mrcgrtz
mrcgrtz / yql.php
Created May 31, 2010 23:26
My simple YQL helper function.
<?php
/**
* Get data via YQL
*
* @author Marc Görtz (http://marcgoertz.de/)
* @see https://gist.github.com/420381
* @license http://creativecommons.org/licenses/by-sa/3.0/de/
* @param string $select YQL query
* @param string $format output format, either 'json' or 'xml' (default: 'json')
* @param string $method HTTP method for accessing YQL (default: 'GET')
@mrcgrtz
mrcgrtz / timestamp2excel.txt
Created June 8, 2010 08:30
Formula to convert a UNIX timestamp (in cell A1) to Excel date format.
=DATE(1970;1;1)+(LEFT(A1;10)/24/60/60)
@mrcgrtz
mrcgrtz / box-shadow.css
Created June 9, 2010 14:28
box-shadow for Opera, Gecko, Webkit and IE8.
.box-shadow {
-webkit-box-shadow: 0 1px 3px #aaa; /* Webkit */
-moz-box-shadow: 0 1px 3px #aaa; /* Gecko */
box-shadow: 0 1px 3px #aaa; /* CSS3 default, should be after vendor-specific properties */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=0, Strength=2)
progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=45, Strength=1)
progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=90, Strength=2)
progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=135, Strength=1)
progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=180, Strength=2)
progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=225, Strength=1)