Skip to content

Instantly share code, notes, and snippets.

View tow8ie's full-sized avatar
🦉
Maybe up too late.

Tobias Adam tow8ie

🦉
Maybe up too late.
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Test for iPhone Events</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta id="viewport" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<style type="text/css" media="screen">
require 'net/https'
class GoogleContactsConnector
GOOGLE_AUTH_HOST = 'www.google.com'
GOOGLE_AUTH_PORT = 443
GOOGLE_AUTH_PATH = '/accounts/ClientLogin'
CONTACTS_BASE_FEED = 'http://www.google.com/m8/feeds/contacts/default/full'
CONTACT_GROUPS_BASE_FEED = 'http://www.google.com/m8/feeds/groups/default/full'
<!--
HTML Test Page for CSS Style Guide
==================================
Originally posted on:
http://www.sitefromscratch.com/content/html-xhtml-css-testing
-->
<!-- Sample Content to Plugin to Template -->
@tow8ie
tow8ie / gist:195532
Created September 28, 2009 16:00
Rails FormStyleHelper module to add appropriate class names to form input elements
################################################################################
# FormStyleHelper
# Adds helpful class names to HTML form elements
################################################################################
# Overrides commonly-used Rails form methods in order to add descriptive
# class names for use in CSS.
#
# This code is released under the terms of the MIT License
#
# Author: Kenn Wilson
@tow8ie
tow8ie / gist:209871
Created October 14, 2009 07:52
Helper method to inject another helper‘s block into a partial
# A technique borrowed from http://www.igvita.com/2007/03/15/block-helpers-and-dry-views-in-rails/
# Only need this helper once, it will provide an interface to convert a block into a partial.
# 1. Capture is a Rails helper which will 'capture' the output of a block into a variable
# 2. Merge the 'body' variable into our options hash
# 3. Render the partial with the given options hash. Just like calling the partial directly.
#
def block_to_partial(partial_name, options = {}, &block)
options.merge!(:body => capture(&block))
concat(render(:partial => partial_name, :locals => options))
end
@tow8ie
tow8ie / gist:213677
Created October 19, 2009 19:56
Some JS code I wrote back in 2005 to create a sliding menu. Animation timing and “cross-browser” functionality was all done “by hand”. Despite of bad coding style it still shows how jQuery & Co. and a culture of widespread JS knowledge totally changed the
/*
* SlideMenu
* ~~~~~~~~~
*
* Version: 1.0.0
* Datum: 29.12.2005
* Autor: Tobias Adam
*
* Getestet auf: Win IE 6.0
* Win IE 5.5
@tow8ie
tow8ie / gist:215487
Created October 21, 2009 21:39
A really hacky proof-of-concept of how to model template abstraction by multi-block helper functions.
class Box
def parse(title, &block)
puts "<box>"
puts "<title>#{title}</title>"
block.call(Column.new).parse
puts "<box>"
end
end
class Column
@tow8ie
tow8ie / _box.html.haml
Created October 22, 2009 21:45
Another very hacky proof-of-concept of template abstractions by multi-block helper functions. This time in a more concrete implementation as Rails helpers.
.box
%h2= title
.body= block
@tow8ie
tow8ie / gist:407439
Created May 20, 2010 10:39
Sass mixins for quick-and-dirty-targeting of IE
// Visible for IE <= 7
=ie7-hack($property, $ie7-value)
##{$property}: #{$ie7-value}
// Visible for IE <= 6
=ie6-hack($property, $ie6-value)
_#{$property}: #{$ie6-value}
-# Ist es so im Quelltext?
%a(href="/") Selbermachen - Das Heimwerkerlexikon
%ul
%li
Hefte
%li
Abonnement
%li
CD-Roms