Skip to content

Instantly share code, notes, and snippets.

View jfahrenkrug's full-sized avatar

Johannes Fahrenkrug jfahrenkrug

View GitHub Profile
require 'base64'
contents = IO.read('/Users/johannes/Code/opensocial/images/screenshot.png')
data = Base64.encode64(contents)
puts %{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<img src="data:image/png;base64,#{data}"/>
# 2009, Johannes Fahrenkrug, http://springenwerk.com
# Licence: use it however you want.
# make sure we at least have the input file as an argument
if ARGV.size != 2
puts "Usage: ruby inliner.rb inputfile outputfile"
else
inputfile = ARGV[0]
outputfile = ARGV[1]
puts "Input file: #{inputfile}"
/*
* MODIFIED by Johannes Fahrenkrug (http://springenwerk.com) to also read TIFF files
* Copyright 2007 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
<?xml version="1.0" encoding="UTF-8"?>
<!--
MODIFIED by Johannes Fahrenkrug (http://springenwerk.com) to make it work on the Mac.
Thanks to http://groups.google.com/group/zxing/browse_thread/thread/2ad34ac61ac6ef75/676c804d44d40947?lnk=gst&q=mac#676c804d44d40947
Copyright 2007 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
// 2008 by Johannes Fahrenkrug, http://blog.springenwerk.com
@implementation AccountViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Initialization code
self.title = @"Settings";
// NSMutableData * declared in .h
receivedData = [[NSMutableData data] retain];