Skip to content

Instantly share code, notes, and snippets.

View jfahrenkrug's full-sized avatar

Johannes Fahrenkrug jfahrenkrug

View GitHub Profile
@jfahrenkrug
jfahrenkrug / gist:797152
Created January 26, 2011 18:17
test.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Das style-Element</title>
<style type="text/css">
p { position: absolute; top: 0; left:0; padding:0px; margin: 0px; color:red; font-family:Helvetica,sans-serif; }
body { margin: 0px; padding: 0px;}
</style>
</head>
<body>
@jfahrenkrug
jfahrenkrug / awesome_split.js
Created November 17, 2010 09:53
A SproutCore SplitView that lets you programmatically collapse views.
// ==========================================================================
// Project: ImageSearch.AwesomeSplitView
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals ImageSearch */
/** @class
(Document Your View Here)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Vapor.js UTF-8 Art!</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Johannes Fahrenkrug">
<!-- Date: 2010-09-26 -->
<!doctype html>
<html><head>
<title>Woof! The ASCII Dog</title>
<meta charset="utf-8">
</head><body style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<div style="width:400;height:400;font-family:monospace;font-size:xx-small;letter-spacing:-2px;background:#FFF;line-height:0px" id="r"><span style="color:rgb(142,162,171);background:rgb(142,162,171);">ਜ</span><span style="color:rgb(142,162,171);background:rgb(142,162,171);">ਜ</span><span style="color:rgb(142,162,171);background:rgb(142,162,171);">ਜ</span><span style="color:rgb(145,165,174);background:rgb(145,165,174);">ਜ</span><span style="color:rgb(145,165,174);background:rgb(145,165,174);">ਜ</span><span style="color:rgb(149,169,176);background:rgb(149,169,176);">ਜ</span><span style="color:rgb(136,153,160);background:rgb(136,153,160);">ਜ</span><span style="color:rgb(148,165,172);background:rgb(148,165,172);">ਜ</span><span style="color:rgb(146,163,170);background:rgb(146,163,170);">ਜ</span><span style="color:rgb(149,166,
javascript:var el = $$('p:nth-child(10)')[0]; var txt = el.innerHTML.replace('scenarios, environments, and conditions', 'scenarios, environments, and <a href="http://www.gourmethausstaudt.com/">bars in Redwood City</a>'); el.update(txt);
-(void)drawInContext:(CGContextRef)myContext {
CGContextSaveGState(myContext);// 6
CGFloat potentialFlip = 1.0;
CGFloat shadowBlur = 4;
CGFloat shadowOffset = 4;
CGFloat shadowOffsetNeg = shadowOffset * -1.0;
CGFloat x = self.bounds.origin.x + shadowOffset;
CGFloat y = self.bounds.origin.y + shadowOffset;
CGFloat wd = self.bounds.size.width - (shadowOffset * 2);
# in 2010 by Johannes Fahrenkrug, http://springenwerk.com
# See you at WWDC!
require 'rubygems'
require 'open-uri'
class WWDC2010
def self.announced?
title = open('http://developer.apple.com/wwdc') do |f|
f.detect { |line| line =~ /<title>/ }
- (void)scaleImage:(float)aScaleFactor
{
//see: http://maettig.com/code/css/css-transform.html
var styleObject = [imageView imageLayer]._DOMContentsElement.style;
if (CPBrowserIsEngine(CPWebKitBrowserEngine) && (typeof styleObject.WebkitTransform != "undefined"))
{
styleObject.WebkitTransform = "scale(" + aScaleFactor + ")";
[[imageView imageLayer] setNeedsDisplay];
}
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/oigdrgh286E&hl=en_US&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/oigdrgh286E&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
@import <Foundation/CPObject.j>
@import <MapKit/MKMapView.j>
@import <MapKit/MKMarker.j>
@import <MapKit/MKLocation.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib