Skip to content

Instantly share code, notes, and snippets.

View itod's full-sized avatar

Todd Ditchendorf itod

View GitHub Profile
The initial Fluidium 0.1 release is based on the browser code powering both Fluid SSBs and Cruz (www.fluidapp.com, www.cruzapp.com).
Almost all of the code included in this project was updated prior to this release, and some of it was rewritten completely. Most of the rewriting was done due to messiness/poor architecture in the old codebase, and because I've learned a lot while writing and maintaining a Cocoa browser codebase over the past two years.
Stuff that was completely rewritten (and therefore may not be well-tested yet):
- FUDocumentController/FUDocument/FUWindowController/FUTabController/FUWindow : this is the code which handles basic browser window/tab management, and is the core functionality of the browser. It conforms to the Cocoa Document-based application design pattern.
- Userscripting : previously, Fluid and Cruz userscripting was based on GreaseKit. That has been removed and replaced with a new implementation in Fluidium.
An important heads up for anyone following the project: Last night I was able to remove
the largest dependencies in the Fluidium project: The OmniFrameworks.
I have been using the OmniFrameworks for only one purpose: the Preferences Window API
in OmniAppKit. This required also linking to OmniBase and OmniFoundation. OF and OA
are very large frameworks, and the part I was using (the Preferences Window API) was
a very very small part. So although the OmniFrameworks are wonderful, it didn't make
sense for the project to have these huge dependencies when only a very small part
was being used.
@itod
itod / black-textfields-safari-5.1.7-xcode3-10.5-SDK
Created May 26, 2012 19:53
Safari 5.1.7 update: Cocoa apps built in Xcode3 against 10.5 SDK which link to WebKit show black text fields when rendering web content
Sorry it's taken me so long to get back to you on this. Three reasons for that:
1. I had not been able to reduce the problem fully, and I prefer to write "clean" Radars with easy steps to reproduce.
2. This issue is NOT actually affecting me in the current version of any of my shipping products, so it's not a high priority for me. In fact, it's not a priority for me at all (and honestly, I doubt it is for anyone else either).
3. I have RSI and typing all this up is a bit difficult.
So to be clear, this issue is not affecting me in any way currently, and I am writing this just to follow up and share info in case you are interested and/or need to track this down. I doubt this is a terribly important issue for you or the rest of the WebKit team/community. As far as I'm concerned you may ignore this issue completely.
So my <a href="https://twitter.com/itod/status/201434495365283840">original statement</a> of web rendering being "broken" was a bit hyperbolic. Also, I was wrong about the PPC connection. The culp
@itod
itod / js_closure.js
Last active October 6, 2015 20:38
JavaScript Closure
function foo() {
var res = [];
for (var i = 0; i < 3; i++) {
res.push(function() {
document.write(i);
});
}
return res;
}
@itod
itod / py_closure.py
Last active October 6, 2015 20:38
Python Closure
def foo():
res = []
for i in range(3):
def bar():
print i,
res.append(bar)
return res
funcs = foo()
for func in funcs:
@itod
itod / objc_closure.m
Last active October 6, 2015 20:38
Objective-C Closure
// compiled with ARC enabled
NSArray *foo() {
NSMutableArray *res = [NSMutableArray array];
for (int i = 0; i < 3; i++) {
[res addObject:^{
NSLog(@"%d", i);
}];
}
return res;
@itod
itod / pdfmultipage.m
Created August 16, 2012 21:05
PDF Rendering white background
- (NSData *)PDFDataForMultiPageDocument {
NSMutableData *data = [NSMutableData data];
CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData((CFMutableDataRef)data);
if (NULL == consumer) {
NSLog(@"could not create consumer");
return nil;
}
CGRect r = CGRectMake(0.0, 0.0, 800.0, 600.0);;
@itod
itod / remove_prefix.applescript
Last active November 21, 2016 03:56
AppleScript to remove a common prefix from the name of all files in a given folder.
set path_ to (get path to desktop as string) & "FOLDER NAME HERE"
set prefix_ to "PREFIX HERE"
tell application "Finder"
set dir_ to folder path_
set files_ to items of dir_ whose name of it starts with prefix_
set start_ to (get length of prefix_) + 1
repeat with file_ in files_
set oldname_ to name of file_
set end_ to length of oldname_
@itod
itod / rename_retina.applescript
Last active November 21, 2016 03:56
Rename 2x images to "@2x" and move them to a parallel folder structure of 1x images
set doubleDirPath_ to "path to 2x images"
set singleDirPath_ to "path to 1x images" -- also destination path
set ext_ to ".png"
set extLen_ to length of ext_
set suffix_ to "@2x"
tell application "Finder"
set doubleDir_ to folder doubleDirPath_
set singleDir_ to folder singleDirPath_
set dirs_ to (get every item of doubleDir_)
@itod
itod / fluid_gmail.js
Last active July 9, 2020 10:42
Gmail Fluid App Userscript
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var newBadge = '';
var res = findInboxAnchorMatchResult();
if (res) {