Skip to content

Instantly share code, notes, and snippets.

View evadne's full-sized avatar
🎣
gone fishing

Evadne Wu evadne

🎣
gone fishing
View GitHub Profile
- (void) shakeWindowHorizontally:(NSWindow *)inWindow duration:(float)inDuration vigour:(float)inVigour times:(int)inTimes {
// [self shakeWindowHorizontally:window duration:0.5 vigour:0.05 times:8];
CAKeyframeAnimation *shakeAnimation = [CAKeyframeAnimation animation];
NSRect inFrame = [inWindow frame];
CGMutablePathRef shakePath = CGPathCreateMutable();
CGPathMoveToPoint(shakePath, NULL, NSMinX(inFrame), NSMinY(inFrame));
int index;
#define FLICKR_METHODS_VIA_POST \
@"flickr.blogs.postPhoto", \
@"flickr.favorites.add", \
@"flickr.favorites.remove", \
@"flickr.groups.pools.add", \
@"flickr.groups.pools.remove", \
@"flickr.photos.addTags", \
@"flickr.photos.delete", \
@"flickr.photos.removeTag", \
@"flickr.photos.setContentType", \
@evadne
evadne / CPBundle.sj
Created December 17, 2009 05:52 — forked from nickjs/CPBundle.sj
/*
* CPBundle.sj
* AppKit
*
* Created by Nicholas Small.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- (void) setAccessoryView: (NSView *)view {
if (view == nil) {
[accessoryView removeFromSuperview];
return;
}
NSView *themeFrame = [[self contentView] superview];
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically
// Example:
// $(document).ready(function() {
// ProvideHtml5.autofocus()
// ProvideHtml5.datepicker()
// ProvideHtml5.forcenumber()
// })
var ProvideHtml5 = {
autofocus = function() {
01:10:57 evadne at Tacitus ~ $ capp gen testingApplication
Creating Frameworks directory in /Volumes/Data/testingApplication/Frameworks.
Copying /usr/local/narwhal/packages/objective-j/Frameworks/Objective-J to /Volumes/Data/testingApplication/Frameworks/Objective-J
Copying /usr/local/narwhal/packages/objective-j/Frameworks/Debug/Objective-J to /Volumes/Data/testingApplication/Frameworks/Debug/Objective-J
Copying /usr/local/narwhal/packages/cappuccino/Frameworks/Foundation to /Volumes/Data/testingApplication/Frameworks/Foundation
Copying /usr/local/narwhal/packages/cappuccino/Frameworks/Debug/Foundation to /Volumes/Data/testingApplication/Frameworks/Debug/Foundation
Copying /usr/local/narwhal/packages/cappuccino/Frameworks/AppKit to /Volumes/Data/testingApplication/Frameworks/AppKit
Copying /usr/local/narwhal/packages/cappuccino/Frameworks/Debug/AppKit to /Volumes/Data/testingApplication/Frameworks/Debug/AppKit
01:10:57 evadne at Tacitus ~ $ capp gen testingApplicationLinked -l
@evadne
evadne / .siFancyScrollbar.less
Created February 20, 2010 04:01
Fancy Scrollbar (in WebKit). Written using LESS, needs gem to compile down to regular .CSS.
.siFancyScrollbar {
::-webkit-scrollbar,
::-webkit-scrollbar-button:start:increment,
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment,
::-webkit-scrollbar-button:end:decrement {
width: 9px;
height: 9px;
@evadne
evadne / monoValidate.js
Created February 21, 2010 02:15
monoValidate (yup, with an easter egg)
// monoValidate.js by Evadne Wu, this version retrieved 2010. 02. 21. New BSD.
// Library required: jQuery. Evadne is reachable thru monoceroi.com.
// Notice: malformed URIs galore and our URI schema has not been tested against with many real-world cases yet.
function monoValidate(stringToBeValidated, proposedCategory) {
// So we can leniently call monoValidate to validate against nothing; that way everything that is not required to be validated is valid
/* helveticSafari shoos Arial away for Safari / WebKit users. Safari — Preferences — Advanced — Style Sheet. */
@font-face {
font-family: "Arial";
src: local("Helvetica");
}
@evadne
evadne / plNews.js
Created March 13, 2010 12:08
Punchy Live’s twitter interactivity engine that is going to be polished and extended into monoTwitterEngine
// plNews.js
/*
Delegate methods:
plNewsDidReceiveNewerTweets to delegate object
plNewsDidReceiveOlderTweets to delegate object
*/