Skip to content

Instantly share code, notes, and snippets.

@michaelschade
michaelschade / gist:658871
Created November 1, 2010 21:08
The Services.h for accentuateus-osx-service as described on http://mschade.me/
#import <Cocoa/Cocoa.h>
@interface Services : NSObject {
}
- (void)accentuate:(NSPasteboard *)pboard
userData:(NSString *)data
error:(NSString **)error;
@end
@michaelschade
michaelschade / gist:658891
Created November 1, 2010 21:13
The Info.plist for accentuateus-osx-service as described on http://mschade.me/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ...Source above redacted for brevity -->
<key>CFPlugInUnloadFunction</key>
<string></string>
<!-- new material -->
<key>LSBackgroundOnly</key>
@michaelschade
michaelschade / main.m
Created November 1, 2010 21:07
The main.m for accentuateus-osx-service as described on http://mschade.me/
/*
Copyright 2010 Spearhead Development, L.L.C. <http://www.sddomain.com/>
[GPLv3 license information redacted for brevity, included at end of post.]
*/
#import "Services.h"
int main(int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@michaelschade
michaelschade / gist:658873
Created November 1, 2010 21:09
The Services.m for accentuateus-osx-service as described on http://mschade.me/
#import "Services.h"
@implementation Services
- (void)accentuate:(NSPasteboard *)pboard
userData:(NSString *)data
error:(NSString **)error {
NSString *text;
NSArray *types;
types = [pboard types];
@michaelschade
michaelschade / gist:658995
Created November 1, 2010 22:33
The GPLv3 redacted snippet for accentuateus-osx-service as described on http://mschade.me/
/*
This file is part of Accentuate.us.
Accentuate.us is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Accentuate.us is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@michaelschade
michaelschade / gist:661985
Created November 4, 2010 01:07
Handling the Gecko +-2.0 Add-On Manager for a post at http://mschade.me/
try { // Old addon manager
let gExtensionManager = Components.classes[
"@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
let version = gExtensionManager.getItemForID(
"addons-mozilla@accentuate.us").version;
Charlifter.Lifter.init(version);
} catch(err) { // New addon manager
Charlifter.Util.log(err);
Components.utils.import("resource://gre/modules/AddonManager.jsm");
BEGIN:vCard
VERSION:3.0
FN:Frank Dawson
N:Dawson;Frank;;;
ORG:Lotus Development Corporation
ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive;Raleigh;NC;27613-3502;U.S.A
TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
TEL;TYPE=FAX,WORK:+1-919-676-9564
EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
EMAIL;TYPE=INTERNET:fdawson@earthlink.net
@michaelschade
michaelschade / hs-vcard-example.hs
Created April 28, 2011 03:33
hs-vcard Example
import Text.VCard
vc = VCard "Frank Dawson"
(IndividualNames ["Dawson"] ["Frank"] [] [] [])
[ Organization ["Lotus Development Corporation"]
, Address [AddrWork, AddrPostal, AddrParcel] "" ""
"6544 Battleford Drive"
"Raleigh" "NC" "27613-3502" "U.S.A"
, Telephone [TelVoice, TelMessage, TelWork] "+1-919-676-9515"
, Telephone [TelFax, TelWork] "+1-919-676-9564"
@michaelschade
michaelschade / Skeleton.hs
Created May 20, 2011 21:13
Skeleton html' and htmlBody functions
{- These imports will serve us for the remainder of the post -}
import Text.Blaze.Internal
import Text.Blaze.Html5
import Text.Blaze.Html5.Attributes
import qualified Data.ByteString.Char8 as C8
import qualified Data.Text as T
-- | HTML tag with no closing.
html' :: Html -> Html
html' = Parent "html" "<html" ""
@michaelschade
michaelschade / skeleton-index.html
Created May 20, 2011 21:13
Skeleton HTML Index
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><html lang="en"><![endif]-->